Page 1 of 1

How best to rename many text files with 1st line of text?

PostPosted: Thu Jul 27, 2023 5:07 pm
by dealtek
Hi Folks,

I have a bunch of text files in a folder that I would like to modify.

Currently, the filename is not useful.

I would like to be able to grab the first line of each text file and use that as the new filename title and rename each file with the 1st line.

I am curious how best to batch process all items in the folder with Hazel?

Thanks Dave

Re: How best to rename many text files with 1st line of text

PostPosted: Fri Jul 28, 2023 10:11 am
by Mr_Noodle
Look up match patterns in the help.

One trick you can use is that the "anything" token will match anything up to the next thing in the pattern, or a newline, whichever comes first.

Re: How best to rename many text files with 1st line of text

PostPosted: Fri Jul 28, 2023 1:38 pm
by dealtek
Thanks very much for the help.