i have around 100 text files. The files have questions and 3 choices. FIles are like below

ab001.txt -- contains question
ab001a.txt -- is the first choice
ab001b.txt ---is second choice
ab001c.txt --- is third choice

There are thousnad files like this.

now i want to insert them in sql or first may in excel like

First columns questions and other three columns as answers

First two characters are same for soom files , looks like it signifies osme category so around every 30 questioons have same first charaters

Any ideas

link|improve this question

69% accept rate
feedback

1 Answer

An easy way to put these into Excel is to combine all the questions into one file, open it from Excel and put the result into column 1. Then do the same with all the first choices and put them into column 2, second choices into column 3, and then the third choices into column 4.

From a Unix or Linux command line interface you could do the following:

cat [a-z][a-z][0-9][0-9][0-9].txt > questions
cat [a-z][a-z][0-9][0-9][0-9]a.txt > choicea
cat [a-z][a-z][0-9][0-9][0-9]b.txt > choiceb
cat [a-z][a-z][0-9][0-9][0-9]c.txt > choicec
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.