Page 1 of 1

Single file move/rename

Posted: Tue Mar 25, 2014 7:59 am
by Zhivago
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.

Re: Single file move/rename

Posted: Fri Mar 28, 2014 5:15 pm
by Support_Rick
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" />