Skip to main content

Thread: convert pdf to text in a for loop


hi have folder containing pdf's there small problem because input file names have spaces in it. , pdftotext command seem have problems because of that.

how conversion

code:
for f in *.pdf     pdftotext $f $f.txt done
could please me out

double quote every expansion , possibly contain special character, e.g. "$var", "$@", "${array[@]}", "$(command)". see: http://mywiki.wooledge.org/quotes , bashfaq 020 (link in signature).

code:
#!/bin/bash    shopt -s nullglob nocaseglob    file in ./*.pdf       pdftotext "$file" "${file%.*}.txt"  done


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] convert pdf to text in a for loop


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account