.TXT to .XML using python 3.4.2



I'm new to python, I wanted to know how to read a .txt file and the output should be in .xml format.


I have the input file as



1. Text of question 1
a) Option 1.a b) Option 1.b
c) Option 1.c d) Option 1.d

2. Text of question 2
a) This is an example of Option 2.a
b) Option 2.b has a special char α
c) Option 2.c
d) Option 2.d

3. Text of question 3
a) Option 3.a can span multiple
lines.
b) Option 3b
c) Option 3c
d) Option 3d


Any suggestions?


No comments:

Post a Comment