# Compress data that has been saved using Put?

Posted 2 years ago
2650 Views
|
2 Replies
|
3 Total Likes
|
 Just want to confirm that the Put function does not have an option for compressing large expressions (associations, upwards of 1GB). So, if I compressed the saved files after the fact, will Get automatically decompress them? There is nothing to that effect in the documentation, so I am assuming not.Greg
2 Replies
Sort By:
Posted 2 years ago
 I think you have 2 options:1) Use Import instead of Get: In[131]:= ExampleData[{"Text", "AliceInWonderland"}] >> "~/alice.m" (* From the command line: \$ gzip ~/alice.m *) In[136]:= Import@"~/alice.m.gz" // StringTake[#, 100] & Out[136]= "I--DOWN THE RABBIT-HOLE Alice was beginning to get very tired of sitting by \ her sister on the bank, " 2) Comprress the data first, then use Put:  In[137]:= Compress[ExampleData[{"Text", "AliceInWonderland"}]] >> "~/alice-compressed.m" In[139]:= Uncompress[Get@"~/alice-compressed.m"] // StringTake[#, 100] & Out[139]= "I--DOWN THE RABBIT-HOLE Alice was beginning to get very tired of sitting by \ her sister on the bank, "