开发者

gzip several files and pipe them into one input

开发者 https://www.devze.com 2022-12-29 15:34 出处:网络
I have this program that takes one argument for the source file and then it parse it. I have several files gzipped that I would like to parse, but since it onl开发者_JAVA百科y takes one input, I\'m wo

I have this program that takes one argument for the source file and then it parse it. I have several files gzipped that I would like to parse, but since it onl开发者_JAVA百科y takes one input, I'm wondering if there is a way to create one huge file using gzip and then pipe it into the only one input.


Use zcat - you can provide it with multiple input files, and it will de-gzip them and then concatenate them just like cat would. If your parser supports piped input into stdin, you can just pipe it directly; otherwise, you can just redirect the output to a file and then invoke your parser program on that file.

If the program actually expects a gzip'd file, then just pipe the output from zcat to gzip to recompress the combined file into a single gzip'd archive.

http://www.mkssoftware.com/docs/man1/zcat.1.asp

0

精彩评论

暂无评论...
验证码 换一张
取 消