We have a sequence of large data files (LAMMPS dump files) which begin like this:
ITEM: TIMESTEP
400000
ITEM: NUMBER OF ATOMS
22518
ITEM: BOX BOUNDS pp pp pp
0 527.757
0 532.678
-3.79681 3.79681
ITEM: ATOMS id x y z c_eng
22248 1.57153 2.05797 0 -0.700402
8 4.8285 3.9563 0 -0.683748
22250 5.24995 0.416325 0 -0.559546
The file continues for 22515 lines.
In the past we would delete the preamble lines through ITEM: ATOMS
... and use ReadList
to harvest the data. Now the file set is too large and we need to automate reading the file, header and all. That is, point to a data file and return numeric values for TIMESTEP, NUMBER OF ATOMS, BOX BOUNDS
, and an array {id, x, y, z, energy}
. What is the best use of Mathematica for such a case?