Message Boards Message Boards

0
|
6691 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

How do I Export and then Import using GZIP (or equivalent) ...?

I think I've gotten the Export part working but can't Import the expression again correctly.

I'm starting with a triangular array of 7X2 integer elements where each row is packed, but I'd settle for any example of Export-Import using GZIP.

Thank you.

-- Mark

POSTED BY: Mark Tuttle
2 Replies

Nice example. Here's the problem. (Had to get this from Support.) GZIP returns a String. To undo this one needs ToExpression. In your case, the "CSV" does the necessary conversion.

In hindsight, I can see what's going on. Prospectively, I couldn't figure it out.

Thank you.

POSTED BY: Mark Tuttle
Import[
 Export["7x2.cvs.gz", ConstantArray[1, {7, 2}], {"GZIP", "CSV"}],
 {"GZIP", "CSV"}]

{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract