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

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

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
dealtek
 
Posts: 25
Joined: Mon Jan 21, 2019 2:15 pm

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.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks very much for the help.
dealtek
 
Posts: 25
Joined: Mon Jan 21, 2019 2:15 pm


Return to Support