Hi all
I need some logic/programming help with reading more than one record from a text file. I can read line for line, but I need to stop as soon as the record is finished, push that object to a list, and then continue with a new record until the next one comes up, save to list, etc...
The header of the record always start with G as the first char. The rest if V (Variable), D (Coordinates), M (Insertion Point), etc...
The file contents looks like this: (dummy data)
G FEATURE01 LEVEL01
M -10.5132 10.0000 697.5086
V \~\@ENTITY=LINE
V \~\@PENSTYLE=0
V \~\@PENTHICK=1
D -10.5089 12.0797 697.8155
D -10.4971 13.6198 698.0429
D -10.0399 17.3069 698.5913
D -10.7665 11.6108 699.2279
D -10.6769 15.9840 699.8735
D -10.8229 13.6024 710.4438
G FEATURE02 LEVEL02
M -10.2681 10.0000 700.4186
V \~\@ENTITY=LINE
V \~\@PENSTYLE=0
V \~\@PENTHICK=1
D -10.2269 10.6946 700.4941
D -10.2585 13.1788 700.7637
D -10.2937 15.9480 701.0642
D -10.9494 20.5230 709.1840
D -10.9277 21.4909 709.4517
D -10.8335 23.3862 709.9763
G FEATURE01 LEVEL02
M -15.4500 10.0000 700.4174
V \~\@ENTITY=LINE 0.00 0 0.00 A A
V \~\@PENSTYLE=0 0.00 0 0.00 A A
V \~\@PENTHICK=1 0.00 0 0.00 A A
D -15.5690 12.3042 700.6673
D -15.3502 14.3130 700.8863
D -15.1219 16.7179 701.1480
D -15.0628 17.3409 701.2427
D -15.5481 20.8968 709.2855
D -15.3132 22.9163 709.8470
D -15.1355 23.2957 709.9627
G FEATURE03 LEVEL03
P 0.0000 0.0000 0.0000 270.0000 90.0000
M -12.8612 14.2951 737.6336
V \~\@ENTITY=LINE
V \~\@PENSTYLE=1
V \~\@PENTHICK=1
V @0ver1ay=KOOS
D -13.2715 15.5321 736.5965
So, as from above there is 4 records in the text file. Any ideas? Thanks