Created
October 6, 2013 11:21
-
-
Save theharshbhatia/6852791 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#"Convert text file into xml" | |
#by Hash113 | |
k=[] | |
q=open("quote.txt") | |
d=open("final.txt",'w') | |
i=0 | |
w=q.readlines() | |
for i in range(0,len(w)-1): | |
f=w[i] | |
a=w[i+1] | |
a=a.strip() | |
f=f.strip() | |
if (len(f)>14): | |
quote=f | |
d.write("<note>\n\t<author>"+a+"</author>\n\t<tag></tag>\n\t<quote>"+f+"</quote>\n</note>\n\n") | |
""" | |
<note> | |
<author>Albert Einstein</author> | |
<tag>Victory</tag> | |
<quote>Failure is just a state of mind</quote> | |
</note> | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment