Page 1 of 1

contents contain match over two lines or take next line

PostPosted: Sat Dec 19, 2020 2:18 am
by demian
Hi there,

right now i use the big online shop of am... quite a lot. The bills came all as ocr-pdf with the name invoice and i want to rename it with the date of purchase and the items i bought. The items are in one line but sometimes it is line 18, sometimes line 19 and sometimes line 22. When i am using the number of occurance it works but not for all files...

But every bill has in the line above or below the same text or number. So i want to use contain match to search for the line above or below, which works pretty fine, and the next contain match should match to the whole line for the item i bought. And this i can not realize.
Is there a way to do that?
Or is it possible to figure out the line number with the number above and use this for the next contain match as number of occurance?

I was looking and searching for help couple hours and maybe i was not using the right keywords for searching... I‘m sorry for that.

Thanks in advance!
demian

Re: contents contain match over two lines or take next line

PostPosted: Mon Dec 21, 2020 11:37 am
by Mr_Noodle
If you use a space character, that will match any amount of spaces or newlines. Using that, you can have a pattern match the text on the line above, then a space, then a pattern for the items below.

Re: contents contain match over two lines or take next line

PostPosted: Mon Dec 21, 2020 6:17 pm
by demian
Mr_Noodle wrote:..use a space character...


That's it! Thank you very, very much! It was just the blank/space character which i did not try. With that, it is amazing and this ist the rule i was looking for. But the only thing i had to change, was, i had to use the keyword below because of the bill not because of hazel. But with "pattern - space - keyword" it does exactly what i expected.

Tomorrow i gonna buy hazel for sure...