I am trying to get the last three lines of every 10 line chunk into mathematica as a data variable. The text file has 3 columns. For example:
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
11 11 11
12 12 12
13 and so on
14
15
16
17
18
19
20
I need in Mathematica to be the following:
{{8, 8, 8}, {9, 9, 9}, {10, 10, 10}, {18, 18, 18}, {19, 19, 19}, {20, 20, 20}}
So far, I have tried using data = ReadList["file.txt",{Real,Real,Real}] to manually import them all and select them after that, but this file is very large and that process takes too much memory for my machine. Is there any way using streams to import these specific lines? Additionally, can this file be read and directly put into a "file.mx" so that the data takes a lot less memory. I have tried doing DumpSave["file.mx",data] once I had the specific data I wanted, but it doubled the memory usage of Mathematica.