I have around 240 files with lots of data, I have been using Import[]
to import these data for further processing. But as my simulations are growing bigger, I am having lots of difficulty importing them, my computer is freezing and lagging (my computer has 6GB RAM). I was wondering if there is a better (less memory intensive) option to import these files?
I have been using the following loop command to import this data as strings and then converting them to numbers
Rawdata = Table[
s = ToString[j];
Import["C:\\Users\\Downloads\\Run 6 new z=45 sigma =0.845\\pinocchio." <>
StringTake[s,2] <> "." <> StringDrop[s,2] <> ".example.catalog.out",
"Data"],
{j, 200000, 420000, 1000}];
Is there an analogous way to import the files without using so much memory?
=.
) the variable you want to clear, or use ClearAll or Remove. $\endgroup$$HistoryLength=0
? if you don't do that Mathematica will remember all output you ever generated in a session. concerning import: if changing the simulation, I'd consider another format for your files, text is just not a very good encoding for numeric data. Other than that, you might find this question and answers to it helpful. If sticking with text, you can read lines with ReadList and type String instead of BindaryReadList as in the answer... $\endgroup$