-
Notifications
You must be signed in to change notification settings - Fork 0
/
DCM-B.sh
54 lines (38 loc) · 875 Bytes
/
DCM-B.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
files=$(cat links.txt)
for file in $files
do
#Download all files
#-q for quite
wget -q $file
done
#Loops through all pdf files and put their name into a file
pdf_to_png=$(ls *.pdf)
for pdf_files in $pdf_to_png
do
echo $pdf_files >> pdffiles.txt
done
#Loops through all files contaning pdf names
for files in $(cat pdffiles.txt)
do
pdftoppm $files $files -png
done
#Remove pdffiles.txt
rm pdffiles.txt
#Takes off ong extensions
takeoff_pngext=$(ls *.png)
for each_ext in $takeoff_pngext
do
echo $each_ext >> pngfiles.txt
done
#Remove everything containing a pdf extension
rm *.pdf
#Read two lines at once of pngfiles.txt
while read -r first_file;read second_file
do
convert +append $first_file $second_file out-$first_file-$second_file
done < pngfiles.txt
#remove pngfiles.txt
rm pngfiles.txt
#remove everything ending with 5
rm 5*