0

I have a file that ends with ".vci_json.gz". My goal is to read the contents of this file using R and write contents in a structured table in CSV format.

I have attempted using the jsonlite package for R like...

dataset1 <- suppressWarnings(stream_in(gzfile("data.vci_json")))

... but I get the following error message "opening gzfile input connection.

Error in open.connection(con, "rb") : cannot open the connection".

Any thoughts how I can get this data in a CSV format?

m0nhawk
  • 22,980
  • 9
  • 45
  • 73
sqlbg
  • 73
  • 1
  • 11
  • 1
    Is there a reason you left off the ".gz" part in the file name when calling `gzfile()`? – MrFlick Nov 20 '18 at 20:43
  • @MrFlick, when I download the file that's how it appears on my desktop--without '.gz' even though the full extension is ".vci_json.gz" before downloading the file. – sqlbg Nov 20 '18 at 20:55
  • Is your operating system hiding the file extension from you? What does `list.files()` show? – MrFlick Nov 20 '18 at 21:01
  • I used "list.files()" and yes, it appears to be hiding the file extension. It's showing "Custom Office Templates" for this file and showing the extension as ".vci_json.gz". – sqlbg Nov 20 '18 at 21:07
  • @MrFlick When I add the '.gz' extension to gzfile I get the following error message. `opening gzfile input connection. Error: parse error: premature EOF { (right here) ------^ closing gzfile input connection.` – sqlbg Nov 20 '18 at 21:18
  • What exactly is in this file? File extensions can lie. – MrFlick Nov 20 '18 at 21:22

0 Answers0