Carlos-Francisco Méndez-Cruz

Transform soft file in XML file

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