cancel
Showing results for 
Search instead for 
Did you mean: 

unzip a compressed file with multiple files and extract a single file on receiver folder

0 Kudos


Hello Everyone,

I have a FTP to FTP scenario where I have "ABC.tar.gz" file on the sender side. I have to unzip this file which has "ABC.TXT" and "ABC.LOG" files.

I am able to create a .txt file with the following configurations on sender channel:

However, I don't get the desired output. The "ABC.TXT" file generated on the receiver side has the content of "ABC.LOG" as well.

Below is the file generated. I want my content to start from 0003|AB......

How should I eliminate the front content of my output file starting from "ABC.txt        00000664    0000147.........to oracle2 dba"?

Please advise.

Thank you!

Regards,

Sim

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

How can we eliminate the unwanted part from the target file structure?

Former Member
0 Kudos

Hi Simran,

From which file are you getting the data ABC.txt        00000664    0000147.........to oracle2 dba"?

Can you give more details what is the requirement? What are the info you need to get from ABC.TXT and ABC.LOG?

0 Kudos

Hi Jennilyn,

The zip file is in "GZIP" format. When I try to unzip it with the parameter "zip.mode=gunzip" I get the text file with some additional data in the front of ABC.TXT file which is not required. I just need the extract starting from 0003 from the below screen.

Former Member
0 Kudos

Hello!

Are the unwanted lines of the output generated by the zip-module or is this the content of your second file?

Is this one big line without linebreak? You can find out by using a different editor like Notepad++

If the structure of the file is always the same, you can you MessageTransformBean to transform the textstream to XML and then remove the lines in the mapping or even directly by the bean.

Of course, you would need to transform it back to CSV in the receiver.

0 Kudos

Hello Heiko,

These extra lines are NOT the content of second file.

Yes, the file will always be in the same format. Now how would I be able to eliminate the unwanted lines? Do I have to use ESR for this purpose? I have not been using ESR for this scenario.

I think these extra lines are the result of "gunzip" parameter.

Also the receiver needs a text file generated started from 0003|AB......

Please could you guide on using MessageTransformBean for eliminating the front lines from the unzipped file?

Thank you!

Former Member
0 Kudos

Appart from the MessageTransformBean solution, which depends on the real content and linebreaks:

Have you tried "unzip" instead of "gunzip"?

0 Kudos

I did. But it is not giving me right output format because my zip file is "GZIP"