LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-02-2008, 11:41 PM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Rep: Reputation: 30
What is an easy way to search phrases in pdf, MSword files?


I am looking for an easy way to search for a phrase in pdf, ps, or Msword files. Something quick and easy like "grep".
Does anyone know any tool to do so?
 
Old 02-03-2008, 08:44 AM   #2
MyHeartPumpsFreon
Member
 
Registered: Oct 2007
Location: The States, Florida
Distribution: Lonely Werewolf
Posts: 251

Rep: Reputation: 30
Um... grep? I think you answered your own question there.

Brandon
 
Old 02-03-2008, 11:32 AM   #3
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Original Poster
Rep: Reputation: 30
I was using grep, but it did not seem to work since those pdf and MsWord are binary.
Are there any option i should provide to the "grep" to read pdf?
 
Old 02-03-2008, 03:19 PM   #4
MyHeartPumpsFreon
Member
 
Registered: Oct 2007
Location: The States, Florida
Distribution: Lonely Werewolf
Posts: 251

Rep: Reputation: 30
I think the -a switch can output binary to text. Try it and let us know how it goes.

Code:
grep -a 'string' /location/of/file
Brandon
 
Old 02-03-2008, 03:37 PM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Alternatively, for the ps and pdf files use pfdtxt <pdf file> | grep <phrase> or ps2ascii <ps file> | grep <phrase>.
For the M$ Word documents you could try catdoc <word file> | grep <phrase>.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pdf search text question shogun1234 Linux - Software 4 09-19-2007 01:11 PM
writing a c code for scanning files for certain phrases raklo Programming 3 06-21-2007 11:47 AM
wine 0.9 can't open files using msword torsin Linux - Software 5 11-18-2005 11:10 PM
How do I unpack pdf.pdf files corbis_demon Linux - General 5 10-29-2004 09:12 PM
editor that reads & writes msword doc files leobing Linux - General 3 04-08-2004 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration