in reply to Multiple Line Data from text file to SQL
My reading of your sample data would suggest you have the format:
(Unique integer). (Question)"/n" A)(Answer A)"/n" B)(Answer B)"/n" C)(Answer C)"/n" D)(Answer D)"/n"
A similar question was asked yesterday. Likely the easiest solution is to assume a line that starts with a letter and a close parenthesis is the start of the next answer. You might find regular expressions useful to write that test. I suspect there will be more of a challenge differentiating the end of D) from the id number of the next question. If you haven't thought about it yet, a hash of hashes is probably the best solution for storing your read data.
Good luck, and please post code if you run into development headaches.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiple choice from text file to SQL
by pie2re (Initiate) on Mar 03, 2009 at 20:43 UTC | |
by kennethk (Abbot) on Mar 03, 2009 at 21:24 UTC |