I have a directory containing different text files such as:
ajac001a00.24o
ajac001a15.24o
ajac001a30.24o
.
.
areg001a00.24o
areg001a15.24o
areg001a30.24o
.
.
I need to combine these text files separately, starting with the same four characters, such as
cat *ajac* > ajac_combined
cat *areg* > areg_combined
How can I do this using a loop? There are too many files starting with different characters that exist, therefore this cannot be done using cat command manually.