tftpfilelist, tftpget and tfileinputdelimited

One Star

tftpfilelist, tftpget and tfileinputdelimited

Hello,
i want to fetch all files from a remote directory with tFtpGet one after another and want to process each of them with tFileInputDelimited. My Problem is, that i don't know how i put the filename from the received file to the tFileInputDelimited component. Of course i could use the same local Filename for each remote file and put this into tFileInputDelimited, but i don't want to do that.
Asume that the remote files are:
file1.csv
file2.csv
file3.csv
my local dir is d:/temp
so the first file i have to process with tFileInputDelimited is "d:/temp/file1.csv", the second is "d:/temp/file2.csv" and so on.
My workflow is:
tFtpConnection->onSubjobOK->tFtpFileList->iterate->tFtpGet->OnComponentOK->tFileInputDelimited->row1(main)->tLogRow
Can someone help me with this?
Kind Regards
Holger
Employee

Re: tftpfilelist, tftpget and tfileinputdelimited

Hi:
Try to modify your job as follow:
tFtpConnection->onSubjobOK->tFtpFileList->iterate->tFtpGet->Run if->tFileInputDelimited->row1(main)->tLogRow
//only replace OnComponentOK with Run if
tFtpGet filemask: "((String)globalMap.get("tFTPFileList_1_CURRENT_FILE"))", Local Directory: "d:/temp"
Run if condition: ((String)globalMap.get("tFTPGet_1_CURRENT_STATUS")).equals("File transfer OK.")
tFileInputDelimited File Name/Input Stream: "d:/temp/"+((String)globalMap.get("tFTPFileList_1_CURRENT_FILE"))
ps: take care of the component's tail number