Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to import files from an smtp server, put them locally and rename them. All this on a daily basis.
The files are in the form “filename+date.csv” except that I want to remove the date from the names of the various files.
Currently, I'm able to retrieve the files and put them locally, but I can't set the tFileCopy component to remove the date characters from the file name.
Thanks à lot
Before:
After:
Use this to remove the date from files (this example assumes .csv files with _ between the filename and the date, so modify the RegEx as needed):
((String)globalMap.get("tFileList_1_CURRENT_FILE")).replaceAll("_[0-9]{8}\\.csv$", "\\.csv")
I've used this and it works: