I have many .pdf files being saved to a directory throughout the day and they are saved with a consistent filename with index values separated by ^. For example the filename could be:
First Name^Last Name^City^State^LastDate^datetime.pdfI need to reorder the variables slightly so it matches up with our archive import system. Something as simple as:
State^City^First Name^Last Name.pdfI'm using a File created trigger and then the Rename tasks uses the File.Result.Name variable to know which file to rename.
For the new filename mask I'm using GetColumn to pull each variable between the ^ separator and rebuild the new filename and I'll show this with line breaks between each index values:
{STRING(GetColumn|1|4|^|{TRIGGER(Active|e05d3af3-be95-48d0-9b0a-bd9cc4d65e9c|File.Result.Name)})} ^
{STRING(GetColumn|1|3|^|{TRIGGER(Active|e05d3af3-be95-48d0-9b0a-bd9cc4d65e9c|File.Result.Name)})} ^
{STRING(GetColumn|1|1|^|{TRIGGER(Active|e05d3af3-be95-48d0-9b0a-bd9cc4d65e9c|File.Result.Name)})} ^
{STRING(GetColumn|1|2|^|{TRIGGER(Active|e05d3af3-be95-48d0-9b0a-bd9cc4d65e9c|File.Result.Name)})}.pdf
It works up to two index values but anything after 2 and it renames the file to "Column number (3) higher than existing columns(1).pdf". I think I need to switch to regex...
On a side note, it shows an output error 77777 Invalid Characters in Filename , even though it renames the file properly with 1 or 2 index values, so I just turned that off from the Exit Code Collection.
Edited by moderator
2017-09-20T14:22:28Z
|
Reason: Not specified