Created
October 6, 2013 11:21
-
-
Save theharshbhatia/6852791 to your computer and use it in GitHub Desktop.
Revisions
-
hash113 created this gist
Oct 6, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #"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> """