I have a text file (digit.txt) consisting of one column includes three digit numbers whose range are 001-...365. In the same directory, I have data text files. The file name of these data files as follows, jplg3240.18i
. Only the jplg
part is constant. I need to order jplg
data files w.r.t. the numbers in the digit.txt file using the first 5-7 characters of the file names and store them in another text file. For example:
digit.txt=
005
301
350
005
010
data files= jplg001.18i.txt, jplg005.18i.txt, jplg301.18i.txt, jplg350.18i.txt,jplg010.18i.txt, jplg365.18i.txt
Output file should be this one:
output=
jplg005.18i
jplg301.18i
jplg350.18i
jplg005.18i
jplg010.18i