Skip to main content

Hello,

Is it possible to read and unzip .tar files?

 

 

I have an interesting project that starts with a .tar file, I need to unzip that to get a .gz file, need to unzip that to get another .tar file, one final unzip to get a folder containing the data I need to edit.

 

So in short the structure:

 

.tar -> unzip -> .gz -> unzip -> .tar -> unzip = folder containing DBF and SHP files I need to edit.

 

Once edits have been made I need to zip everything back up in reverse order.

How would I do this?

 

Thanks, all the best,

 

Ed

Hi @edhere, FME doesn't directly support packing/unpacking with gz and tar format. However, if you install an external command line tool which supports gz and tar, you can embed its functionality to a workspace using the SystemCaller transformer.

Probably 7-Zip is a good tool for your purpose. 7-Zip installation contains a help documentation including how to use it from command line.


Hi @edhere, FME doesn't directly support packing/unpacking with gz and tar format. However, if you install an external command line tool which supports gz and tar, you can embed its functionality to a workspace using the SystemCaller transformer.

Probably 7-Zip is a good tool for your purpose. 7-Zip installation contains a help documentation including how to use it from command line.

I tested extracting process using 7-Zip and SystemCallers, and it worked fine. Assuming these parameters are defined.

 

  • $(7Z_EXE): The "7z.exe" file path
  • $(SOURCE_TAR): The source "*.tar" file path
  • $(DEST_FOLER): A directory path to which extracted folder will be saved finally.


Thanks @takashi , I'll give it a try.

Best,

 

Ed

Reply