I have some pdf files about 2000 pages. They are randomly generated. I need to extract some pages that contain some specific patterns, that changes its page number for every pdf. With some steps I can get the page numbers and I store some info into a csv file like that:
PatternA ; 1 3 5 7 PatternB ; 1 8 10 22
I have been trying to do a loop to get and process each line from this csv into the cat option from pdftk command, but it aways return error:
$IFS=$(printf '\n\t') for line in cat job.csv
do pattern=echo $line ¦ cut -d ';' -f 1
pages=echo $line ¦ cut -d ';' - f 2
pdftk input.pdf cat $pages output $pattern done
When echoing pattern and pages variables, everything are ok. But the pdftk command returns error if I try to get pages from $pages variable.
What I am doing wrong?
Thanks!
Aucun commentaire:
Enregistrer un commentaire