It's a bit unclear what you want. Do you have a fixed list of input files? you could try:-
for identifier in WFX QTFX MAFX AVFX FWX
do
cat ABC_NYF${identifier}.txt ABC_CYF${identifier}.txt > ABC_TYF${identifier}.txt
done
Does that do what you need? If not, can you answer these:-
Is this homework/assignment? There are specific forums for these.
What have you tried so far?
What output/errors do you get?
What OS and version are you using?
What are your preferred tools? (C, shell, perl, awk, etc.)
What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?
There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.
We're all here to learn and getting the relevant information will help us all.
Here is the actual requirement.. There are files generated for current year and next year in a particular folder , I need to concatenate these two files into a total year file ,
For example ABC_NYFWFX.txt and ABC_CYFWFX.txt , these two files indicate next year and current year , FWFX indicate forecast fx rates .
Yes there are fixed set of files , I am really new to unix , I have perl and shell scripting ,I just tried using cat to concatenate these , but I want to do using loop ,I hope the code given by you works ,Not tested though, Thanks Much