Bella
Newbie level 6
how to parse *.list file in c++
start
name
units
2
begin
a: 12,0.7,12,12.5
b: bb, 23, 24, 10
c: cc, 23.5, 24.5, 12
d: dd, 22.5, 22.5, 13
e: 10,12,12
end
name1: abc,12, 12
name2: 12.5,12.5, 14
name3: 12.5,12.5,ab1,ab2,ab3
stop
The above is the text file sample.txt. I have to read the file and parse the above text file. How to parse each separately using C++?. Between begin and end, I have to parse each after ":" . Is there any simple logic to parse them?.
start
name
units
2
begin
a: 12,0.7,12,12.5
b: bb, 23, 24, 10
c: cc, 23.5, 24.5, 12
d: dd, 22.5, 22.5, 13
e: 10,12,12
end
name1: abc,12, 12
name2: 12.5,12.5, 14
name3: 12.5,12.5,ab1,ab2,ab3
stop
The above is the text file sample.txt. I have to read the file and parse the above text file. How to parse each separately using C++?. Between begin and end, I have to parse each after ":" . Is there any simple logic to parse them?.