C++ I have a file like this -------------------------------------------------------------------------------- 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 10000000000000000000000000000000000000000000000000000000000000000000000000000000 01000000000000000000000000000000000000000000000000000000000000000000000000000000 00100000000000000000000000000000000000000000000000000000000000000000000000000000 00010000000000000000000000000000000000000000000000000000000000000000000000000000 00001000000000000000000000000000000000000000000000000000000000000000000000000000 00000100000000000000000000000000000000000000000000000000000000000000000000000000 00000010000000000000000000000000000000000000000000000000000000000000000000000000 00000001000000000000000000000000000000000000000000000000000000000000000000000000 00000000100000000000000000000000000000000000000000000000000000000000000000000000 00000000010000000000000000000000000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- 11111111100000000000000000000000000000000000000000000000000000000000000000000000 00000000011111111100000000000000000000000000000000000000000000000000000000000000 00000000000000000011111111000000000000000000000000000000000000000000000000000000 10000000010000000000000000000000000000000000000000000000000000000000000000000000 01000000001000000010000000000000000000000000000000000000000000000000000000000000 00100000000100000001000000000000000000000000000000000000000000000000000000000000 00010000000010000000100000000000000000000000000000000000000000000000000000000000 00001000000001000000010000000000000000000000000000000000000000000000000000000000 00000100000000100000001000000000000000000000000000000000000000000000000000000000 00000010000000010000000100000000000000000000000000000000000000000000000000000000 00000001000000001000000010000000000000000000000000000000000000000000000000000000 00000000100000000100000001000000000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- 10001000100000000000000000000000000000000000000000000000000000000000000000000000 00010000011000000000000000000000000000000000000000000000000000000000000000000000 00100010000000000000000000000000000000000000000000000000000000000000000000000000 00000010000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00111000000000000000000000000000000000000000000000000000000000000000000000000000 00000000010000000000000000000000000000000000000000000000000000000000000000000000 00000001101000000000000000000000000000000000000000000000000000000000000000000000 11000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 11111001111000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 How do I read this file in columns by columns? (The file has 12 rows x 80 columns for each part, each part has seperate by dash line. When reading file, ignore dash lines, store data (read column by column) in a vector.)
C++
I have a file like this
--------------------------------------------------------------------------------
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
10000000000000000000000000000000000000000000000000000000000000000000000000000000
01000000000000000000000000000000000000000000000000000000000000000000000000000000
00100000000000000000000000000000000000000000000000000000000000000000000000000000
00010000000000000000000000000000000000000000000000000000000000000000000000000000
00001000000000000000000000000000000000000000000000000000000000000000000000000000
00000100000000000000000000000000000000000000000000000000000000000000000000000000
00000010000000000000000000000000000000000000000000000000000000000000000000000000
00000001000000000000000000000000000000000000000000000000000000000000000000000000
00000000100000000000000000000000000000000000000000000000000000000000000000000000
00000000010000000000000000000000000000000000000000000000000000000000000000000000
--------------------------------------------------------------------------------
11111111100000000000000000000000000000000000000000000000000000000000000000000000
00000000011111111100000000000000000000000000000000000000000000000000000000000000
00000000000000000011111111000000000000000000000000000000000000000000000000000000
10000000010000000000000000000000000000000000000000000000000000000000000000000000
01000000001000000010000000000000000000000000000000000000000000000000000000000000
00100000000100000001000000000000000000000000000000000000000000000000000000000000
00010000000010000000100000000000000000000000000000000000000000000000000000000000
00001000000001000000010000000000000000000000000000000000000000000000000000000000
00000100000000100000001000000000000000000000000000000000000000000000000000000000
00000010000000010000000100000000000000000000000000000000000000000000000000000000
00000001000000001000000010000000000000000000000000000000000000000000000000000000
00000000100000000100000001000000000000000000000000000000000000000000000000000000
--------------------------------------------------------------------------------
10001000100000000000000000000000000000000000000000000000000000000000000000000000
00010000011000000000000000000000000000000000000000000000000000000000000000000000
00100010000000000000000000000000000000000000000000000000000000000000000000000000
00000010000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00111000000000000000000000000000000000000000000000000000000000000000000000000000
00000000010000000000000000000000000000000000000000000000000000000000000000000000
00000001101000000000000000000000000000000000000000000000000000000000000000000000
11000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
11111001111000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
How do I read this file in columns by columns?
(The file has 12 rows x 80 columns for each part, each part has seperate by dash line. When reading file, ignore dash lines, store data (read column by column) in a vector.)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images