Skip to content

Instantly share code, notes, and snippets.

@pedro-stanaka
Created February 14, 2016 20:49
Show Gist options
  • Select an option

  • Save pedro-stanaka/9f00abcc9efb820bb9d9 to your computer and use it in GitHub Desktop.

Select an option

Save pedro-stanaka/9f00abcc9efb820bb9d9 to your computer and use it in GitHub Desktop.
def convert(in_file, out_file):
name = ""
for line in in_file:
line = line.strip()
print(line)
if line == "":
continue
if line.startswith('"'):
name = line.strip('"')
print("NAME:: " + name)
else:
out_file.write("{0}\n".format(','.join([name] + line.split("\t")) ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment