Skip to content

Instantly share code, notes, and snippets.

@modille
Created March 6, 2017 17:00
Show Gist options
  • Save modille/dd069f6cd6fefdf3601fe88d1c292ff3 to your computer and use it in GitHub Desktop.
Save modille/dd069f6cd6fefdf3601fe88d1c292ff3 to your computer and use it in GitHub Desktop.
Recursively find and grep through multiple Excel spreadsheets
# convert *.xlsx to *.xlsx.csv using https://github.com/dilshod/xlsx2csv
pip install xlsx2csv
# (shell-fu from http://stackoverflow.com/a/12965604)
find . -iname "*.xlsx" -exec sh -c 'xlsx2csv "$1" > "$1.csv"' x {} \;
# grep .csv files
brew install ripgrep
rg -i -g "*.csv" "waldo"
# ...or plain ole grep
grep -ir --include "*.csv" "waldo" .
@rot26
Copy link

rot26 commented May 31, 2019

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment