0

Something like the answer here: https://superuser.com/questions/313187/search-text-in-multiple-excel-files but on linux mint..

xlsx files within a folder that contain the string

0

As a supplement to the linked answers in the comments.

Having had to search and recover a trashed file system full of un-backed up excel files this is a snippet of the script I used in a loop over several hundred large excel files to search for keywords. The filename is passed in as $f and the search string in $s. The middle line was just tidying up the output for my own purposes and you can probably throw it away.

found=$(unzip -p "$f" | grep -Pio -m 1 "$s" 2>/dev/null)
found=$(echo $found | sed 's/[ ,/]/./g')
echo "found $found in $f"

My advice is simply this ....don't forget -m 1 as an option to the grep to quit once you have found the first match or you will waste a lot of time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.