I have a large file that I need to parse into a tab delimited file for use in a database. While I can get it parsed to a certian extent, entries with multiple lines to the questions and answers are throwing me for a loop!! Can anyone please show me the correct method for doing this? Here is an excerpt from the file:
____________________________________________________________
G1B Antenna structure limitations; good engineering and
good amateur practice; beacon operation; restricted
operation; retransmitting radio signals
G1B01 (C) [97.15a]
Provided it is not at or near a public-use airport, what is
the maximum height above ground an antenna structure may
rise without requiring its owner to notify the FAA and
register with the FCC?
A. 50 feet
B. 100 feet
C. 200 feet
D. 300 feet
G1B02 (B) [97.101a]
If the FCC Rules DO NOT specifically cover a situation, how
must you operate your amateur station?
A. In accordance with standard licensee operator
principles
B. In accordance with good engineering and good amateur
practice
C. In accordance with station operating practices adopted
by the VECs
D. In accordance with procedures set forth by the
International Amateur Radio Union
____________________________________________________________
sections like the top one "G1B Antenna structure..." should be completely ignored when parsed.
G1B01 (C) [97.15a] should be 5 seperate elements. (G1,B,01,C,[97.15a])
Multiple lines of either a question or answer should be a single element with each answer choice being seperate of course.
I was able to parse another similar but much simpler file (ie. no multi lines) for a website. The results of which can be seen here
Any help would be sincerely and greatly appreciated!!
BTW... the parsing is done on my local machine then the output file is uploaded to the server.
____________________________________________________________
G1B Antenna structure limitations; good engineering and
good amateur practice; beacon operation; restricted
operation; retransmitting radio signals
G1B01 (C) [97.15a]
Provided it is not at or near a public-use airport, what is
the maximum height above ground an antenna structure may
rise without requiring its owner to notify the FAA and
register with the FCC?
A. 50 feet
B. 100 feet
C. 200 feet
D. 300 feet
G1B02 (B) [97.101a]
If the FCC Rules DO NOT specifically cover a situation, how
must you operate your amateur station?
A. In accordance with standard licensee operator
principles
B. In accordance with good engineering and good amateur
practice
C. In accordance with station operating practices adopted
by the VECs
D. In accordance with procedures set forth by the
International Amateur Radio Union
____________________________________________________________
sections like the top one "G1B Antenna structure..." should be completely ignored when parsed.
G1B01 (C) [97.15a] should be 5 seperate elements. (G1,B,01,C,[97.15a])
Multiple lines of either a question or answer should be a single element with each answer choice being seperate of course.
I was able to parse another similar but much simpler file (ie. no multi lines) for a website. The results of which can be seen here
Any help would be sincerely and greatly appreciated!!
BTW... the parsing is done on my local machine then the output file is uploaded to the server.