I'm having a problem with a script which should ultimately provide a filename by reading a value from file1 and file2 then join together.
I'm planning to use a loop/ loops to get the values out of both files and create a single string unfortunately the code currently treats the second loop (which is how I have written it to be fair) as nested instead of working simultaneously. The thing is that my sanity is slowly slipping away so I have stripped the code back to try and get a clearer picture.
The file's contain:
num.txt
65
65
66
67
first.txt
MRO0122
MRO0112
MRO0112
MRO0113
Currently the code returns:
MRO011365
MRO011365
MRO011366
MRO011367
What I want is
MRO012265
MRO011265
MRO011266
MRO011367
Anyway here's the code:
for update in `cat num.txt`
do
echo $update
for filename1 in `cat first.txt`
do
echo $filename1
truefile=$filename1$update.TXT
done
echo $truefile
done
Let me know if this is post is confusing in it's description and i'll try to provide clearer detail.