Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
Sorry for my english skills, my java skills & my Talend skills that is all pretty new to me & I'm learning everyday here.
I'm currently working on something that I have no idea how the best I should start on. I have an FTP access where they will be files which are named like "TEXT_yyyyMMdd_hhmm". I have to sort get the latest files (so sort by alphabetic I guess?), do some data transform (xml to csv, new column ... = tMap?) then load back on the FTP the files and delete only the oldest.
So if i have :
1. TEXT_20180506.xml
2. TEXT_20180504.xml
3. TEXT_20180508.xml
4. .....
I want to only get the TEXT_20180508.xml , put it in a Tmap & output it on the same FTP with .csv . And once its done, delete the oldest one (TEXT_20180506.xml).
What should be the best way ?
I can only think of tftpconnection > tftpget > tmap (+java code) > outputdelimited but I dont feel it.
Looking for advices; Thanks !
Thanks @manodwhb , Now i get 2 files with my tFTPGet. But I dont see any order/sort possibilites with my settings on tFTPFileList. So it doesnt order at all and my tFileInputXML return a "null" for : (String)globalMap.get("tFileList_1_CURRENT_FILEPATH") .
Here is a screenshot :
Thanks !
@daez,you should use tFilelist not tFTPFileList
@daez,please find the below after the first file has processed you need to abort the job since this way.
instead of tJava place,you should use your logic to convert xml to csv.
@daez,please accept solution and also provide Kudos
@manodwhb, Yes i was about to do that, i just didnt see your last post before i reply, why should I add a tdie?
I added a tdie after my tFileOutput with the link " on component OK " but I have no "iterate " row like yours, I dont understand what it does.
@daez,if you do not want to iterate use tdie.otherwise do not use.