Skip to content

Instantly share code, notes, and snippets.

@ishiy1993
Last active December 25, 2016 06:32
Show Gist options
  • Save ishiy1993/393fb1037f84e66e2bfb2db058c17eca to your computer and use it in GitHub Desktop.
Save ishiy1993/393fb1037f84e66e2bfb2db058c17eca to your computer and use it in GitHub Desktop.
#!/bin/bash
unzip hanshin.xlsx
cat xl/sharedStrings.xml | hxselect si -s '\n' | sed 's;</t.*;;' | sed 's;.*>;;' | awk '{print "s;s"(NR-1)";"$1";g"}' | tac > table
cat xl/worksheets/sheet1.xml | hxselect row -s '\n' | sed 's/<[^<]*>/ /g' | awk 'NR>1{print $1,"s"$2,"s"$3}' > temp
sed -f table temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment