Renaming files from RegEx patterns

Post Reply
NEOSA
Newbie
Posts: 1
Joined: Fri Dec 12, 2014 10:55 pm

Renaming files from RegEx patterns

Post by NEOSA »

Hi All@Community :-)



I used to setup in the past some workflows from a competitor product from DALiM.



For sorting and creating files, we were using functionalities based on RegEx :



Pattern = (.+)_(.+)_(.+)_(.+)_(.*[^0-9])?0*([0-9]+)(.*)

Path LowRes = /Volumes/DATA/Secure/SecuriZ/[string range #1 0 7]/[string range #2 0 5]/[string range #3 0 10]_[string range #4 0 2]/Placements

File EPS = [string range #3 0 10]_[string range #4 0 2]_[format %03d #6].eps



The STRING_RANGE was used to pickup some characters inside each part of the incoming file.



Example : [string range #3 0 10]_[string range #4 0 2]_[format %03d #6].eps



was creating a file by picking the first eleven characters of the pattern #3, 3 characters of the pattern #4, format %03d #6 formatting the page number (001, 002, etc... 999).



How do you proceed with SWITCH to have a such behaviour ?



The main goal is :



- Let say input file is DOCUMENT_NAME_PRODUCTCODE.pdf

- Create hierarchy by picking any of the characters like DOCUMENT or NAME or PRODUCTCODE, by eventually cropping them to reduce the numbers of characters,

- Final PDF files will be DOCUMENT_NAME_PRODUCTCODE_001.pdf, DOCUMENT_NAME_PRODUCTCODE_002.pdf, .../... DOCUMENT_NAME_PRODUCTCODE_999.pdf



I know how to used "Split files" from SWITCH.



Many thanks for ideas and comments ;-)



Bye
Post Reply