Carlos-Francisco Méndez-Cruz

Transform soft file in XML file

...@@ -48,6 +48,8 @@ if __name__ == "__main__": ...@@ -48,6 +48,8 @@ if __name__ == "__main__":
48 regexTagContent = re.compile(r'<(?P<tag>[^>]+)>(?P<content>[^<]+)<') 48 regexTagContent = re.compile(r'<(?P<tag>[^>]+)>(?P<content>[^<]+)<')
49 regexSerie = re.compile(r'^\^SERIES = (?P<serie>GSE[0-9]+)$') 49 regexSerie = re.compile(r'^\^SERIES = (?P<serie>GSE[0-9]+)$')
50 regexSample = re.compile(r'^\^SAMPLE = (?P<sample>GSM[0-9]+)$') 50 regexSample = re.compile(r'^\^SAMPLE = (?P<sample>GSM[0-9]+)$')
51 + tags = ["Technique", "Orgn", "Strain", "Substrain", "Gversion", "Gtype", "Phase", "Air", "Med", "Temp", "Supp",
52 + "pH", "Press", "OD", "Rate", "Vess", "Agit", "Name", "Anti"]
51 # Walk directory to read files 53 # Walk directory to read files
52 for path, dirs, files in os.walk(options.inputPath): 54 for path, dirs, files in os.walk(options.inputPath):
53 for f in files: 55 for f in files:
...@@ -98,7 +100,6 @@ if __name__ == "__main__": ...@@ -98,7 +100,6 @@ if __name__ == "__main__":
98 hashGcs[serie][sample][tag] = [content] 100 hashGcs[serie][sample][tag] = [content]
99 #print("New tag: {} and content: {}".format(tag, content.encode(encoding='utf-8', errors='replace'))) 101 #print("New tag: {} and content: {}".format(tag, content.encode(encoding='utf-8', errors='replace')))
100 # print(hashGcs) 102 # print(hashGcs)
101 - tags = ["Technique", "Orgn", "Strain", "Substrain", "Gversion", "Gtype", "Phase", "Air", "Med", "Temp", "Supp", "pH", "Press", "OD", "Rate", "Vess", "Agit", "Name", "Anti"]
102 #with open(os.path.join(options.outputPath, f.replace(".xml", ".report.csv")), "w", encoding="utf-8") as oFile: 103 #with open(os.path.join(options.outputPath, f.replace(".xml", ".report.csv")), "w", encoding="utf-8") as oFile:
103 with open(os.path.join(options.outputPath, f.replace(".xml", ".report.csv")), "w") as oFile: 104 with open(os.path.join(options.outputPath, f.replace(".xml", ".report.csv")), "w") as oFile:
104 output = '"Serie","Sample",' 105 output = '"Serie","Sample",'
......
1 -print("Hola mundo")
...\ No newline at end of file ...\ No newline at end of file