I have a file with the following format:

###block 1
0011000000
0100010000
1100000000
1110101000

###block 2
110010
001000
010000
111111

I want to create a parser that reads the file line by line but puts each block in a 2D array. Since there are two blocks in this example, they'll be two 2D arrays and then I want to append these two arrays to a list. How can I efficiently code for this because my file is 1GB therefore, would like to do it as elegantly and efficiently as possible? Help would be appreciated.

0 Answers