One Star

[resolved] Unarchive multiple files to one file.

Hi,
i didn't see any option in tFileUnarchive of unarchiving multiple zip files to one single files. Any idea?
i have zip files with same names but with date at the end of the name. I want to unarchive all the files of one day to one file.
regards.
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] Unarchive multiple files to one file.

Thanks everyone,
i made another job to merge the files and its working Smiley Happy
13 REPLIES
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi,
You mean one single directory?
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi Or3l,
yes, suppose i have three files that have date and time in the name.
- Account_1_7_2012_10_55_33.zip
- Account_1_7_2012_11_15_13.zip
- Account_1_7_2012_08_05_22.zip
i want all the files to extract as one file like 'Account_1_7_2012'
any idea?
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi, you can do it by using a tfilelist and tfileunarchive. What I suggest you is that after having unziped the files, put the source files (*.zip) in an other directory to avoid unarchiving them again.
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi,
I think you no need to move the file again to a new folder. tFileList will iterate the file list only once. You just select the directory you want to extract all the files in tFileUnarchive component and then configure the tFileList to loop over the required files. The files passed by the tFileList component will be extracted in the specified directory. If you want to extract the zip files in their own zip file name as folder name then check "Extract File Paths" option in the Basic Settings of tFileUnarchive component.
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi,
I told him to cut the files because I guessed this job will be used more than one time. I agree with you, if this runs only one time, copying files is not needed.
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi
Yes, I agree in case of reusing the Job for the same files set then need to move the file to a new folder.
Thanks for the added points.
One Star

Re: [resolved] Unarchive multiple files to one file.

Thanks a lot Or3l and karthikj18,
what the job do is that it unzip the available .zip files to one directory. Like if i had three .zip files having csv files in each zip file.
- Account_2012_01_18_03_33_45.zip
- Account_2012_01_18_04_38_45.zip
- Account_2012_01_18_05_43_45.zip
It extracted 3 separate csv files in the destination folder.
- Account_2012_01_18_03_33_45.csv
- Account_2012_01_18_04_38_45.csv
- Account_2012_01_18_05_43_45.csv
But i want it to extract the files as on file, like after execution i should have only one file which will have data from all the 3 files and name that file as 'Account_2012_01_18.csv'
how can i merge the files? i hope u understand this :s
please ask if any confusion Smiley Happy
Five Stars

Re: [resolved] Unarchive multiple files to one file.

Hi Abdul_rehman
please have a look on this discussion so can get a idea what you want to achieve
http://www.talendforge.org/forum/viewtopic.php?id=2695
or
http://www.talendforge.org/bugs/view.php?id=4987
One Star

Re: [resolved] Unarchive multiple files to one file.

Thanks everyone,
i made another job to merge the files and its working Smiley Happy
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi,
Sry to reopen it but how did you achieve it? Without using the merge thing, you could have achieved by using a single delimited output (which has the date as name) and check the option "written after". The merge thing is more a concatenation of your data (from what i've seen), that's what you wanted?
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi Or3l,
sure. Actually my requirement changed. 1st it was to unarchive multiple file as one single csv file. But then i wanted to unarchive them separately and merge them in another job. i used
tFileList --> TFileInputDelimited --> TFileInputDelimited
to merger separate csv files as one file. its same as concatenation.
Employee

Re: [resolved] Unarchive multiple files to one file.

You can use instead of tFileInputDelimited a tfilefullrow.
This component extract line by line your file.
And you can use a tfileoutputdelimited with only one field "line".
One Star

Re: [resolved] Unarchive multiple files to one file.

Hi Xavier,
that helped, thanks
regards,