Increment filenames using variables

Post variable and regex related tips, questions.

Increment filenames using variables

Postby Tech Support » Thu Jan 24, 2013 5:47 pm

User Support Request:
We are currently using "Automatize Enterprise" as part of our system to move files between FTP / SFTP servers, but we now need move multiple files at a time cycle, to the same directory, but the file has the same name, need to add a number sequentially to each file transported to not repeat.
for example:
Current transport file = fico.txt
resulting filenames =fico00001.txt , fico00002.txt , fico00003.txt ......

Could you inform us if this is a functionality with in "Automatize Enterprise"? and if so, guide us to a Manual to configure this option?
Thanks in advance for your help.
Tech Support
Site Admin
 
Posts: 1279
Joined: Thu May 25, 2006 11:12 am

Postby Tech Support » Thu Jan 24, 2013 5:48 pm

1) Create a ‘Number Variables’ task with following settings:
Variable Name = Increment
Function = +
Value = 1
New Variable Name = Increment

2) Before you run the FTP task, you should run this task. It will increment the value of the variable. If you ever have to manually edit or reset this variable value, the variable is stored in the file: ..Automize9\data\variables\userVariables . You can edit this file with notepad.

3) In the FTP task , to change the filename from fico.txt to fico1.txt use the following in the Append To filename field (of Ftp task):
P2::$%Increment%$ (case sensitive)
Tech Support
Site Admin
 
Posts: 1279
Joined: Thu May 25, 2006 11:12 am


Return to Variables and Regular Expressions

Who is online

Users browsing this forum: No registered users and 3 guests

cron