Skip to content

Instantly share code, notes, and snippets.

@fcamel
fcamel / str_list.sh
Created June 8, 2011 17:32
prepare "a list of strings" in shell script
files=$(cat <<EOF
1st line
2nd line
3rd line
EOF
)
IFS=$'\n'
for f in $files
do
@brendano
brendano / xlsx2tsv.py
Created November 7, 2008 02:53
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