Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Please, could you confirm if it is correct for discard the last 09 characteres of each file during the identification of them in the directory?
example:
Actual name: integracaonova-22112021
New name: integracaonova
((String)globalMap.get("tFileList_1_CURRENT_FILE")) -9.
Thanks a lot.
Hello,
Using tFileInputFullRow to read each row one by one, remove or replace the special characters in each row and output it to a new file.
The work flow looks like: tFileInputFullRow-->tJavaRow, where you will put:
row1.myRow.replaceAll("", "");
That should remove anything what is NOT a-z or A-Z or 0-9.
Feel free to let us know if it helps.
Best regards
Sabrina
Hello Sabrina, thanks by replay.
I need please remove N characters always in the of End file name but this character can to change.
example felipe12112021
I need. : felipe
eduardo15122022
I need: eduardo
I am using tfileList for load Csv files but the files have in his name the date and time at the end and I need to remove when will load.
Hello,
You are trying to rename files?
I'm supposing that you are using a tFileList, so the filename is associated to the variable tFileList_1_CURRENT_FILE. Using a regex you can get what you want for example
globalMap.get(tFileList_1_CURRENT_FILE).replaceAll ("_[0-9]_.*$", ""))
Here is a resolved related topic about: https://community.talend.com/s/question/0D53p00007vCk1DCAS/using-tjava-for-rename-of-current-filenam...
Hope it helps.
Best regards
Sabrina
Hello,
No, I'm trying only to import some csv's files that have a date at the end of the filename and I need discard this information BEFORE of to use the tFileList component.
I will use the components below to import this csv´s data into different tables in SQL.
How could I just not consider in reading of these files only these characteres at the end of filename?
Components I will use:
tFileList, tIterateToFlow,tMap,tFixedFlowInput, tJavaRow, tRunJob
((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(0, ((String)globalMap.get("tFileList_1_CURRENT_FILE")).length() - 9)
Thanks a lot. I will test it