Ask Your Question
0

How would I search for text across a directory of documents? [closed]

asked 2017-03-29 17:20:35 +0100

context15 gravatar image

updated 2020-09-28 20:36:46 +0100

Alex Kemp gravatar image

In the unix environment, specifically Ubuntu, How would I find all writer documents that contain a word or phrase. The native .odt format is compressed so typical text tools such as grep don't work.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-09-28 20:36:53.561675

Comments

If you edit a post to add information (in this case you added "In the unix environment, specifically Ubuntu" AFTER I had posted below)" it is courteous to state you have done so if it affects others.

JohnHa gravatar imageJohnHa ( 2017-03-30 13:08:47 +0100 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2017-03-30 08:34:36 +0100

robleyd gravatar image

See if you have a utility named zipgrep. If you don't, I can add it here as it is just a small shell script.

edit flag offensive delete link more

Comments

zipgrep gagged. Specific example: A directory of various chicken dishes includes some .doc and some .odt files. When looking for those recipes that require mushrooms, this was the result. I left the M or m off to avoid dealing with capital letters.

zipgrep "ushroom" . [Baked Mustard chicken.doc] End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and . . .

context15 gravatar imagecontext15 ( 2017-03-30 23:11:56 +0100 )edit
0

answered 2017-03-29 17:56:27 +0100

JohnHa gravatar image

updated 2017-03-29 20:22:43 +0100

In Windows click Start.

Type zebra in the Search box.

Choose Show more results to open a window where you can sort by name, folder etc., and also specify exactly which locations to search.

All LO files with zebra in the path, name or in the document text will appear.

This works because LO installs a small utility which sends all words to the Windows search indexer.

Google grep for a utility which searches inside files.

edit flag offensive delete link more

Comments

The original question specified a unix-like environment so the advice for Windows is not useful. Similarly it noted that grep is not useful for compressed files like ODF files.

robleyd gravatar imagerobleyd ( 2017-03-30 10:17:48 +0100 )edit

The original post did not mention Unix. As you can see, the post was edited to add Unix after I had responded with my answer when the poster realised (s)he needed to specify Unix.

Googling grep will find zipgrep.

JohnHa gravatar imageJohnHa ( 2017-03-30 11:03:48 +0100 )edit

I did change the original question to be fore Unix only since the XP Windows search facility off 'start' will find words in a .odt file.

context15 gravatar imagecontext15 ( 2017-03-30 23:07:39 +0100 )edit

Question Tools

1 follower

Stats

Asked: 2017-03-29 17:20:35 +0100

Seen: 1,585 times

Last updated: Mar 30 '17