Rename filename based on contents - file renaming lis
Posted: Thu Feb 20, 2014 10:39 am
Because the output filename is set before the file contents are processed, you can't use a Restrict\Restrict to filename filter to extract the file contents and shove them into the filename.
What you need to do is combine data extracted from the file, with the current filename macro @inputfilename@ or @fullinputfilename@, and manipulate this with 1 or more search/replaces into a CMD.EXE file renaming batch file, in the form of
etc in a .BAT file, set as the output filename of the Output Filter - otherwise you end up overwriting your input file - yikes!
What you need to do is combine data extracted from the file, with the current filename macro @inputfilename@ or @fullinputfilename@, and manipulate this with 1 or more search/replaces into a CMD.EXE file renaming batch file, in the form of
Code: Select all
ren "original filename" "new filename"
ren "original filename" "new filename"
Code: Select all
|--Input from file(s)
|
|--EasyPattern [date: [capture(2 digits) as 'month','-',capture(2 digits) as 'day','-',capture(2 digits) as 'year']] with [ren "@fullinputfilename@" "@year@-@month@-@day@.txt"\r\n]
| [X] Extract matches
|
+--Merge output to file rename_files.bat