A
adpsimpson
Hi, I have a file which I wish to read from C++. The file, created by
another programme, contains both text and numbers, all as ascii (it's
a .txt file). A sample of the file is shown below:
<< LEDAR V1.3 - Real Time Detection >>
<LEFT 144>
<TOP 165>
<RIGHT 265>
<BOTTOM 376>
<STEP 4>
<Kx 2.13068>
<Ky 0.882353>
<Detection 1>
25600055 1
299 299 299 299 299 297 297 297 297 297 297 297 297
299 299 299 299 299 297 297 297 297 297 297 297 297
299 299 299 299 299 297 297 297 297 297 297 297 297
299 299 299 299 299 297 297 297 297 297 297 297 297
26800055 2
300 300 300 300 299 297 297 297 297 298 299 299 299
300 300 300 300 299 297 297 297 297 298 299 299 299
300 300 300 300 299 297 297 297 297 298 299 299 299
300 300 300 300 299 297 297 297 297 298 299 299 299
28000055 3
300 300 300 300 301 301 301 300 301 301 301 301 300
300 300 300 300 301 301 301 300 301 301 301 301 300
300 300 300 300 301 301 301 300 301 301 301 301 300
300 300 300 300 301 301 301 300 301 301 301 301 300
Of the long lines, I want to read one line from each group, and ignore
everything else. I have relatively little experience with C++, and can
not find a suitable way to do this. Any suggestions? Please type a
small bit of sample code to show how suggested functions should be
used.
Thanks! Andrew
another programme, contains both text and numbers, all as ascii (it's
a .txt file). A sample of the file is shown below:
<< LEDAR V1.3 - Real Time Detection >>
<LEFT 144>
<TOP 165>
<RIGHT 265>
<BOTTOM 376>
<STEP 4>
<Kx 2.13068>
<Ky 0.882353>
<Detection 1>
25600055 1
299 299 299 299 299 297 297 297 297 297 297 297 297
299 299 299 299 299 297 297 297 297 297 297 297 297
299 299 299 299 299 297 297 297 297 297 297 297 297
299 299 299 299 299 297 297 297 297 297 297 297 297
26800055 2
300 300 300 300 299 297 297 297 297 298 299 299 299
300 300 300 300 299 297 297 297 297 298 299 299 299
300 300 300 300 299 297 297 297 297 298 299 299 299
300 300 300 300 299 297 297 297 297 298 299 299 299
28000055 3
300 300 300 300 301 301 301 300 301 301 301 301 300
300 300 300 300 301 301 301 300 301 301 301 301 300
300 300 300 300 301 301 301 300 301 301 301 301 300
300 300 300 300 301 301 301 300 301 301 301 301 300
Of the long lines, I want to read one line from each group, and ignore
everything else. I have relatively little experience with C++, and can
not find a suitable way to do this. Any suggestions? Please type a
small bit of sample code to show how suggested functions should be
used.
Thanks! Andrew