LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-22-2015, 11:14 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
pdftotext 0.20.2: pdftotext *.pdf gives syntax error.


How do I fix that?

Last edited by stf92; 01-22-2015 at 11:15 AM.
 
Old 01-22-2015, 11:48 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 10,073

Rep: Reputation: Disabled
This is a syntax error as you are providing pdftotext several arguments but it expects either one (the pdf file) or two (the pdf file followed by the text file) see the man page.

Try this instead:
Code:
for i in `ls *.pdf`; do pdftotext $i; done
 
2 members found this post helpful.
Old 01-22-2015, 11:54 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
You beat me. I had already done it via
Code:
bill@juan:~/lectura/ldd_txt$ cat sc01

LIST=$(ls *.pdf) #ls *.wav interpretado como orden por los parentesis
for i in $LIST ; do
        INPUT=$i
        
       
      	echo "Input=  $INPUT"
	pdftotext $INPUT
done
bill@juan:~/lectura/ldd_txt$
Thank you.

Last edited by stf92; 01-22-2015 at 11:56 AM.
 
Old 01-22-2015, 12:01 PM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 10,073

Rep: Reputation: Disabled
You gan get the same result a simpler way:
Code:
for INPUT in `ls *.pdf`; do echo $INPUT; pdftotext $INPUT; done
 
1 members found this post helpful.
Old 01-22-2015, 12:08 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by Didier Spaier View Post
This is a syntax error as you are providing pdftotext several arguments but it expects either one (the pdf file) or two (the pdf file followed by the text file) see the man page.

Try this instead:
Code:
for i in `ls *.pdf`; do pdftotext $i; done
Wait a moment. The thread title should read ' pdftotext 0.20.2: pdftotext BLANK HERE *.pdf gives syntax error'. Am I missing something important?
 
Old 01-22-2015, 01:08 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 10,073

Rep: Reputation: Disabled
Quote:
Originally Posted by stf92 View Post
Wait a moment. The thread title should read ' pdftotext 0.20.2: pdftotext BLANK HERE *.pdf gives syntax error'. Am I missing something important?
I don't understand what you mean.

Last edited by Didier Spaier; 01-22-2015 at 01:42 PM.
 
Old 01-22-2015, 01:34 PM   #7
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,425

Rep: Reputation: 6062Reputation: 6062Reputation: 6062Reputation: 6062Reputation: 6062Reputation: 6062Reputation: 6062Reputation: 6062Reputation: 6062Reputation: 6062Reputation: 6062
Quote:
Originally Posted by stf92 View Post
Wait a moment. The thread title should read ' pdftotext 0.20.2: pdftotext BLANK HERE *.pdf gives syntax error'. Am I missing something important?
I don't know what you mean by BLANK HERE, but as Didier mentioned, pdftotext does not allow wildcards. You can't use *.pdf when using pdftotext unless you put it in a for loop, like you already did.

It looked like you already answered your own question, so what are you missing?
 
  


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
pdftotext returns "Illegal entry in bfchar block in ToUnicode CMap kjcook Linux - Software 1 09-05-2014 01:43 PM
pdftotext formatting issue theobald7 Linux - Software 2 09-04-2013 01:26 AM
pdftotext consumes 100%cpu power alaios Linux - Software 1 04-02-2007 06:27 PM
pdftotext - How to output to html with ampersand entities ? narc Linux - Software 2 01-04-2006 02:34 PM
xpdf, pdftotext phoenix7 General 7 09-08-2005 02:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:32 AM.

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