Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  28] [ 0]  / answers: 1 / hits: 39580  / 2 Years ago, wed, march 16, 2022, 3:47:37

I know that I can convert pdf files to text files one by one like this :



$ pdftotext filename.pdf


But is there a single command that would make that conversion without specifying separate file names so as to convert them all?



I see here, on Wikipedia, that "Wildcards (*), for example $ pdftotext *pdf, for converting multiple files, cannot be used because pdftotext expects only one file name."


More From » pdf

 Answers
7

The following will convert all files in the current directory:



for file in *.pdf; do pdftotext "$file" "$file.txt"; done

[#34478] Wednesday, March 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ncharm

Total Points: 255
Total Questions: 105
Total Answers: 118

Location: Virgin Islands (U.S.)
Member since Sat, May 6, 2023
1 Year ago
ncharm questions
;