## Single file move/rename

Posts: 1
Joined: Wed Oct 26, 2011 1:11 pm

Post by Zhivago » Tue Mar 25, 2014 7:59 am
I have a instance where a file is posted on our FTP server with a name like:

FSE-MAINES_mmddyyyy_hhmmss.txt

I need to place this file in one folder (on another server) as FSE.TXT and a copy of the file in an archive folder (on the same server as the FSE.TXT file).

Not sure how to grab FSE-MAINES_mmddyyyy_hhmmss.txt with a wildcard and do the move or copy with the rename.
Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm

Post by Support_Rick » Fri Mar 28, 2014 5:15 pm
Here's some example XML that you could use to get your desired results:

Code: Select all
<createFileList label="Get list of Files" fileListVariable="MyFileList" version="1.0">
<fileset dir="/Path/To/My/File">
<wildcardFilter>
<include pattern="FSE-*" />
</wildcardFilter>
</fileset>
</createFileList>

<copy label="Copy to Server" sourceFile="${MyFileList}" destFile="\\Server\Path\to\Destination\FSE.txt" whenFileExists="overwrite" version="1.0" /> <copy label="Copy to Archive" sourceFile="${MyFileList}" destFile="\\Server\Path\to\Archive\FSE.txt" whenFileExists="overwrite" version="1.0" />