I have a C++ program that outputs a set of numbers at each time step. A blank line separates successive time steps. Here is an example of my data format:
0.2 42.8
0.4 12.3
0.6 32.1
0.8 37.3
0.2 44.2
0.4 17.8
0.6 39.0
0.8 30.1
I want to import this into Mathematica with the following format:
data = {
{{0.2`, 42.8`}, {0.4`, 12.3`}, {0.6`, 32.1`}, {0.8`, 37.3`}},
{{0.2`, 44.2`}, {0.4`, 17.8`}, {0.6`, 39.`}, {0.8`, 30.1`}}
};
i.e., the data for each time step is in one list. How do I do this?
ReadList
, and particularly theRecordLists->True
option setting. $\endgroup$