Skip to content

Instantly share code, notes, and snippets.

View hsuhanooi's full-sized avatar

Hsu Han Ooi hsuhanooi

  • Seattle, WA
View GitHub Profile
@hsuhanooi
hsuhanooi / xlsx2tsv.py
Created August 7, 2012 23:44 — forked from brendano/xlsx2tsv.py
xlsx2tsv: python command-line script to convert xlsx (Excel "OOXML") into tab-separated values
#!/usr/bin/env python
"""
xlsx2tsv filename.xlsx [sheet number or name]
Parse a .xlsx (Excel OOXML, which is not OpenOffice) into tab-separated values.
If it has multiple sheets, need to give a sheet number or name.
Outputs honest-to-goodness tsv, no quoting or embedded \\n\\r\\t.
One reason I wrote this is because Mac Excel 2008 export to csv or tsv messes
up encodings, converting everything to something that's not utf8 (macroman