I need to merge a few files together the problem is that I have so many files that it will takes me week to get all the job done…
In fact, I wrote a script that put in a text file the name of the files that need to be merged.
foreach stn (`cat ../stnlist`)
ls *$stn.* > tmp$stn
Now I need to add to this script a part where it read each line of tmp$stn and give each filenames (lines) a variable (first one = 1, second one = 2,…). I can’t know in advance how many line I have but shouldn’t be more then 10 each time.
The variables will then be put into the following script so I would also need to be able to count the numbers of lines and also put that into a variables to ask the script to merge x number of files.
/usr/local/sac/bin/sac << endsac
Hope someone could help me… I’m on my master thesis and I don’t have weeks to do that…