I have a file of about 120,000 lines that I would like to export, but because of memory issues it will not let me save it to an excel file. Is there a way to save the data as a zip file? or maybe get around this? thanks.
-
How about look at http://stackoverflow.com/questions/222030/how-do-i-create-7-zip-archives-with-net – Graeme Bradbury Jul 01 '14 at 14:37
1 Answers
The answer depends a lot on your particular circumstances & what you are in control of.
If you want just the data then it would be worth trying to save it as a CSV type (Save As, then change the Save As Type dropdown & choose CSV. You may need to format text/date columns explicitly, or it may not quote them correctly [excel version dependent]
Minimally it can be saved as a DOS txt, but it depends on what data is in the file as to whether it will reopen exactly as prior to save.
Depending on your precise memory issue it might (or might not) be excel or the file itself. Since Excel is known for file bloat - you might also try opening a blank worksheet, then copy & paste the cells & save from there.
If it's windows that is lacking memory (I don't know how wide your rows are) the increasing your page file size may help.
Depending on your data source, you might also try extracting the data in chunks, saving them as CSV or text & then concatenating the file together again (read up on the copy command).
Alternatively, if you have (or can get) the sqlserver client tools then osql or bcp will be able to extract the data directly to a file without going via excel.

- 349
- 2
- 5