Page 1 of 1

renaming a pdf based on its third line

PostPosted: Tue Nov 21, 2023 5:23 am
by samcg
Hello, I'm trying to automate renaming a few hundred pdfs. Is there a way to get hazel to rename a file based on its third line?

Thanks for your help,

Sam

Re: renaming a pdf based on its third line

PostPosted: Tue Nov 21, 2023 12:48 pm
by Mr_Noodle
Is there no structure or pattern to the text otherwise? You could try a pattern like (anything)(anything)(•third line) where (•third line) matches (anything). Not sure if it will work but (anything) is not allowed to cross line boundaries so it will grab the first and second lines in the first two (anything) tokens, at least in theory.

Re: renaming a pdf based on its third line

PostPosted: Thu Nov 23, 2023 7:18 am
by samcg
That's worked! Thanks for your help.