3

I've downloaded some .csv files from the OECD Stats website, since I need them to plot some graphs with gnuplot. When I open them with File Roller 3.4.1 (the default program to handle archive files), there's a file that seems empty (0 byte). When I try on the terminal, I get:

gunzip Financial\ Indicators\ –\ Stocks.gz

gzip: Financial Indicators – Stocks.gz: invalid compressed data--length error
gzip: Financial Indicators – Stocks.gz has more than one entry -- unchanged

So the file seems corrupted, but I sent it to a friend who uses Windows. He extracted the file on his computer and sent me the output: it's a zip files which, in turn, contains two .csv files. So the file is not corrupt, there must be a problem with the packages used to handle them. Any suggestion?

  • 2
    Run file Financial\ Indicators\ –\ Stocks.gz, to see what's actually there. – angus Nov 15 '13 at 11:28
  • The output is: Financial Indicators – Stocks.gz: Zip archive data, at least v3.0 to extract – Luigi Nov 15 '13 at 11:35
5

If it is a zip then the file extension is wrong, and you can not use gunzip. If it contains 2 files then it is not a gzip file, gunzip works with single files, it just compresses, sometimes we use it with tar to combine file. It may be zip or tarred zip .taz

Use file command to find out.

If zip You need unzip.

Also if zip change the file extension, as some tools may use this to detect file type.

  • The output of file is: Financial Indicators – Stocks.gz: Zip archive data, at least v3.0 to extract Now I'll try with unzip – Luigi Nov 15 '13 at 11:36
  • Solved with your answer. Just needed to change its extension to .zip. – Luigi Nov 15 '13 at 11:43
  • Write an angry mail to OECD to make them correct the file extension. – erik Feb 23 '14 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.