Rename filename based on contents - file renaming lis

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

User avatar
DataMystic Support
Site Admin
Posts: 2204
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia

Rename filename based on contents - file renaming lis

Postby DataMystic Support » 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

Code: Select all

ren "original filename" "new filename"
ren "original filename" "new filename"

etc in a .BAT file, set as the output filename of the Output Filter - otherwise you end up overwriting your input file - yikes!

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

Simon Carter, - Insulin dose calculator for Type 1 diabetes - 250,000 free software downloads - send huge email attachments

Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 8 guests