Reputation: 25
I am having a huge .tgz file which is further structured inside like this:
./RandomFoldername1/file1
./RandomFoldername1/file2
./RandomFoldername2/file1
./RandomFoldername2/file2
etc
What I want to do is having each individual file extracted to standard output so that I can pipe it afterwards to another command. While doing this, I also need to get the RandomFoldername
name and file name so that I can deal with them properly from within the second command.
Till now the options I have are
While searching on how to solve this, I've started to fear that there is no better alternative to this.
Upvotes: 0
Views: 69
Reputation: 80931
Using tar
the tool I don't believe you have any other options.
Using a tar library for some language of your choice should allow you to do what you want though as it should let you iterate over the entries in the tarball one-by-one and allow you to extract/pipe/etc. each file one-by-one as necessary.
Upvotes: 2