Re-Ordering a filename, adding to a filename in Switch
Posted: Tue Jan 22, 2013 1:11 pm
Hi
Looking for help/guidance in Re-Ordering and adding to a filename, first a brief background we currently use Dalim Twist to sort hundreds of files a week be it PDF or Images one particular use is to ReOrder a filename using a tool called CheckIncoming this tool uses this RegEx
([A-Z]+)([0-9]+)(.*)(-|_)([0-9][0-9][0-9][0-9][0-9][0-9])(-|_)([0-9]+)(.*)
to look for files that may be named SA1213INCOMINGFILE_123456_01.eps using
#1#2#3#7_#5#8
to ReOrder the file to be SA1213INCOMINGFILE01_123456.eps for reasons i won't go into the six digits needs to be at the end of the filename in this instance.
Twist only uses a very simple RegEx hence not to pretty.
So in Switch looking at the Rename tool we used this RegEx in the Search for
(SAd{4})(.*)(_d{6})(_|-)(d{2})(.*)
and in the Replace by
$1$2$5_$3$6
thinking it may be similar to Twists CheckIncoming or the GREP find and replace in Indesign showing our inexperience, alas it didn't work.
What to do, are we on the right track or will it have to be a Replace by a script expression?
The adding to a filename would be along the same lines Search for
(SAd{4})(.*)(_d{6})(_|-)(d{2})(.*)
and Replace by
$1$2$5_SHAD_$3$6 giving us SA1213INCOMINGFILE01_SHAD_123456.eps
Thanks
Looking for help/guidance in Re-Ordering and adding to a filename, first a brief background we currently use Dalim Twist to sort hundreds of files a week be it PDF or Images one particular use is to ReOrder a filename using a tool called CheckIncoming this tool uses this RegEx
([A-Z]+)([0-9]+)(.*)(-|_)([0-9][0-9][0-9][0-9][0-9][0-9])(-|_)([0-9]+)(.*)
to look for files that may be named SA1213INCOMINGFILE_123456_01.eps using
#1#2#3#7_#5#8
to ReOrder the file to be SA1213INCOMINGFILE01_123456.eps for reasons i won't go into the six digits needs to be at the end of the filename in this instance.
Twist only uses a very simple RegEx hence not to pretty.
So in Switch looking at the Rename tool we used this RegEx in the Search for
(SAd{4})(.*)(_d{6})(_|-)(d{2})(.*)
and in the Replace by
$1$2$5_$3$6
thinking it may be similar to Twists CheckIncoming or the GREP find and replace in Indesign showing our inexperience, alas it didn't work.
What to do, are we on the right track or will it have to be a Replace by a script expression?
The adding to a filename would be along the same lines Search for
(SAd{4})(.*)(_d{6})(_|-)(d{2})(.*)
and Replace by
$1$2$5_SHAD_$3$6 giving us SA1213INCOMINGFILE01_SHAD_123456.eps
Thanks