[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

I need to (pdftotext) process a list of files in one command.

Posted on 2007-08-01
4
Medium Priority
?
288 Views
Last Modified: 2013-12-16
I have a list of PDF docs that I want to convert to text for searching. This is the command I would use on one file:

$ pdftotext 0502EWT.pdf

Is there a way to do it in one shot?  Something in the spirit  of the command below (which does not work):

$ pdftotext $(ls 0*pdf)

thanks,
Frank
0
Comment
Question by:ibanja
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 500 total points
ID: 19609779
pdftotext will not accept multiple files

ls 0*.pdf | while read f; do pdftotext "$f"; done
0
 

Author Comment

by:ibanja
ID: 19609875
excellent ravenpl,

Thanks,
Frank
0
 
LVL 12

Expert Comment

by:Heem14
ID: 19609895
Similar to raven's just another way to do it.. save this as a script and make it executable.. say call it p2t.sh

then you would just type ./p2t.sh 0*.pdf


#!/bin/sh
for file in "$@"
do
pdftotext "$file"
done
0
 

Author Comment

by:ibanja
ID: 19610108
Thanks for the tip Heem14.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month17 days, 21 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question