I'm currently trying to load some data coming from a text file into a database.
Here is a sample of data as it can be found in the file
27509. The Sun's declination is: A) the Sun's position relative to the plane of the Equator. B) the distance between the Sun and the horizon. C) the angular distance between the Sun and the celestial North Pole. D) the Sun's position relative to the ecliptic.
The problem is the following:
I would need to be able to handle the question id (the number on the first line), the question and each answer (a,b,c,d). As you can see in the sample above, the data is not very well formatted and sometimes the answer is spread on several lines. The file contains up to 2500 questions ans answers.
So, basically my question is:
How could I parse the file to isolate every question with its answers even if one answer is spread on several lines?
Thanks a million for your help.
P.
In reply to Multiple Line Data from text file to SQL by pie2re
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |