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.

Revisions

  1. modille created this gist Mar 6, 2017.
    11 changes: 11 additions & 0 deletions grep_xlsx_files.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # 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" .