Renaming PDF based on specific date found #449
Replies: 2 comments
-
|
Hi @MyVizDrake! I Had a similar problem trying to match credit card statements with start and end dates for billing periods. as per debbugging the rule, I start with a broad filter & gradually uncommenting fine grainded filter conditions Some other things to note:
I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
|
@MyVizDrake, a couple of comments, in case you haven't found a solution yet: "Nothing to do" means your filter is failing to match the file. It's not obvious to me why it's failing, but it's likely because of something subtle with the regex and the exact formatting in your PDF file. You can run to see what text the Bank statements can vary in their formatting. My first guess would be I would also suggest you use something more specific than One more tip: If you like, you can use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone!
Organize and regex noob here ...
Trying to find a replacement for the MacOS app Hazel and one of the really cool features is to specify in the content match which date to capture as a variable in order to do date-math. Best example is a Credit Card billing statement which has things like ...
Billing Period: 03/12/24-04/09/24
In the above case I would tell Hazel to match the 2nd date (04/09/24) and then rename the file to 'some_credit_card_202404.pdf' and move it somewhere. Manipulating the detected 2nd date from MM/DD/YY to be YYYYMM.
I think it can kind of be done with
- filecontent: '^Billing Period: \d{2}\/\d{2}\/\d{2}-(?P<statement_date>.*)'to capture 04/09/24 as statement_date but when I runorganize simon the PDF in question it reports "Nothing to do"It's possible my action is messed up and it can't figure out what to do. I was simply trying to find the file(s) first and then simply show I captured the variable.
I am running organize via a scoop.sh installation of Python (3.13) and have poppler installed via scoop.sh as well. I can confirm that I can run pdf2totext on the PDF in question from a shell and I get a txt version of the PDF in question.
The config
I also did a basic check of the regex on the string in question (regex101.com) and it behaved as-expected.
What have I done wrong?
Thanks in advance!
Scott
Bonus points if you can give me a hint as to how to how to manipulate the statement date from MM/DD/YY to YYYYMM but I suspect I'll need to use the python action to handle that part. Baby steps 1st. :-)
Beta Was this translation helpful? Give feedback.
All reactions