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
could please me outcode:for f in *.pdf pdftotext $f $f.txt done
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
Post a Comment