I have a bunch of .raw.gz files which are data files streamed from twitter with JSON interface. I am wondering which command should I use on my Mac OSX to open (unzip) these files? I have tried tar, unzip, gunzip, none of them worked for me.

  • But gunzip should give you the .raw file. Then, are you aware of what the .raw file is? – Xichen Li Mar 11 '11 at 20:47
  • Agree with Xichen. Hence the file use. – Renaud Mar 11 '11 at 20:52
  • This is what I get when I run gunzip hoktay@csreg193>gunzip twitter_20091006.raw.gz gunzip: twitter_20091006.raw.gz: not in gzip format – Huseyin Oktay Mar 11 '11 at 22:08

You should try the file command, if that is available on MacOSX, to check the file type. Anyway, I think you should do that after gunziping the x.raw.gz file (which normally gives you a x.raw file). Normally, you should obtain raw json text file after doing gunzip.

| improve this answer | |
  • This is what I get when I rurn the file command: file twitter_20091006.raw.gz twitter_20091006.raw.gz: data – Huseyin Oktay Mar 11 '11 at 22:10
  • Ouch… Did you try to open the file in text mode and see if there is a human readable text? Could you share how did you get those file? It may help. – Renaud Mar 11 '11 at 22:23
  • This is the information about how the files are obtained.Files contain singular larger continuous ingestions. Files are in JSON format. curlStream.bat was used with a program called cURL to download the Twitter stream. The Twitter API is located at apiwiki.twitter.com/Twitter-API-Documentation. Most JSON fields are defined at apiwiki.twitter.com/Return-Values. curlStream.bat invokes the Twitter Streaming API, with documentation at apiwiki.twitter.com/Streaming-API-Documentation. – Huseyin Oktay Mar 12 '11 at 4:38
  • And I tried to open, but it is not human readable text unfortunately. – Huseyin Oktay Mar 12 '11 at 4:39
  • Ok, I can't test since I don't want to register myself on devtwitter. Anyway, since curl should by default redirect your data on the standard console output my advice is that you could try elementary curl call on the Twitter API when tweaking some curl parameters (see curl -h). – Renaud Mar 12 '11 at 15:30

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.