Rename Remote file
Rename Remote file
/XXXXX/YYYYYY/TRAN090603.txt.GO
it is a "TRIGGER FILE" to let us know when a process has completed and the file can retrieved. I also need to rename this file to /OUTPUT/TRINTECH/TRAN090603.txt.processed. Is this possible through GOAnywhere? I was able to add the '.processed' as a suffix, but ideally I would like to remove the '.GO'.
- LPrendergast
- Verified User
- Posts: 11
- Joined: Tue May 26, 2009 7:54 am
Re: Rename Remote file
Rename a local file using Wildcard pattern:
- Code: Select all
<project name="Rename Test" mainModule="Main" version="1.0">
<description></description>
<module name="Main">
<rename inputFile="D:\temp\TRAN090603.txt.GO" searchPattern="*.GO" replaceWith="*.processed" />
</module>
</project>
Rename a local file using Regex Pattern:
- Code: Select all
<project name="Rename" mainModule="Main" version="1.0">
<description></description>
<module name="Main">
<rename inputFile="D:\temp\TRAN090603.txt.GO" searchPattern="\.GO$" patternType="regex" replaceWith=".processed" />
</module>
</project>
The above project checks the file name to make sure it matches the regular expression "\.GO$". In this pattern "\." is the escape syntax for ".", meaning we search for a period (period in regular expressions has a different meaning, so we had to escape it). Then the pattern needs to match the sequence GO. Finally, the $ tells that there should not be any other characters after GO (end of input match). Then we said, replace the matched substring with ".processed".
The same options are available for renaming remote files using FTP, FTPS or SFTP.
- Support_Sai
Who is online
Users browsing this forum: No registered users and 0 guests