Skip to content

Instantly share code, notes, and snippets.

@typeshige
Created August 6, 2012 18:54
Show Gist options
  • Save typeshige/3277532 to your computer and use it in GitHub Desktop.
Save typeshige/3277532 to your computer and use it in GitHub Desktop.
Convert an itunes export into csv for Excel.
#!/usr/bin/python
file = open('0.txt', 'rb')
lines = []
for line in file:
lines.append(line)
bigline = ''.join(lines)
lines = bigline.split('\r')
for line in lines:
parts = ['"%s"' % part.strip() for part in line.split('\t')]
print ','.join(parts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment