Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
AndyBrown
Contributor
Contributor

tFileArchive Behavior

I'm new to Talend as of 2.3.2 and was attempting the following simple scenario:
1) Fetch a number of files with tFTPGet (this part was successful)
2) After successful completion, use tFileArchive to zip up the five txt files into one archive using a date-time stamp.
Upon execution, I'm experiencing the following exception:
Starting job GetFiles at 14:09 20/05/2008.
Exception in component tFileArchive_1
java.io.FileNotFoundException: C:\Documents\Manufacturers\ACME\ACME Data Stage\ACME_Data_2008-05-20.zip (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at texasinstruments.getfiles.GetFiles.tFileArchive_1Process(GetFiles.java:294)
at texasinstruments.getfiles.GetFiles.tFTPGet_1Process(GetFiles.java:219)
at texasinstruments.getfiles.GetFiles.runJobInTOS(GetFiles.java:447)
at texasinstruments.getfiles.GetFiles.main(GetFiles.java:361)
Job GetFiles ended at 14:12 20/05/2008.
I was under the impression that tFileArchive creates the archive file on the fly. According to the exception it appears as though the archive has to exist beforehand. There is no documentation on tFileArchive as of the latest components guide, nor can I find it anywhere.
Any guidance would be appreciated.
Labels (3)
14 Replies
Anonymous
Not applicable

Thanks Brandon,
It's working now,
now one step further,
is there any way to move and archive a file????
like the "MOVE" command in dos???
I want to archive my file and save it in archived folder then delete the original file.
Thanks in advance.
Anonymous
Not applicable

Hi
You can try the tFileCopy component.
Best regards
Shong
Anonymous
Not applicable

Hi Kyaw Lwin Phyo,
shong description is just fine...you schould use first tFileArchive to archive files, you don't need to move the archive file as soon as you can create it directly in destination folder, but in case, you need to move it explicitly you use tFileCopy where is option to delete source file after copy (here is one thing which could break you into problem if you need to keep the date of file same as source), and then you just use tFileDelete to delete source files.
Ladislav
Anonymous
Not applicable

Hi,
I have one more question.
I want to give my file's name with a time stamp
It will be like "filename_yyyyMMdd_HHmm.dat"
But I have to find this file again in the job so, I want to store the "yyyyMMdd_HHmm" value in a context or variable.
and assign that context or variable to the file name.
Can you direct me how it can be done???
I've tried making a context of type string whose value is TalendDate.formatDate("yyyyMMdd_HHmm",TalendDate.getCurrentDate())
But when i run it i got a file not found exception (I'm to create a file not find for the first time).
and I think the context returns as a string of "TalendDate.formatDate("yyyyMMdd_HHmm",TalendDate.getCurrentDate())" not the actural date time value.
Thank You.
Anonymous
Not applicable

This has been on answered on you other thread
https://community.talend.com/t5/Design-and-Development/File-name-with-a-timestamp/td-p/99356
0683p000009MACn.png
Regards,
Brandon