Hi,
I'd like to write a script which works on various files file1.jpg, file2.jpg ..... These files are splitted and their names are something like file[1-9]_[1-9].XXX. I'd like to merge them and convert them at some moment again in file[1-9].XXX also
file1_1.jpg file1_2.jpg ... >file1.pdf
file2_1.txt file2_2.txt ... >file2.pdf
I'd use for loop and I need there to specify the variable - the first part of the filename. I'd write
for file in *[#-#]_*.jpg
do for i in {#-#}
do convert .....
done
done
I don't know how many files I'd use for the conversion in advance because it varies, I even't don't know the names file1, file2 and their amount. I'd need to get it know from the folder, somehow count the amount of file1_xxx files and the amount of file[1-9] files.
How can I do that?
Thank you very much!