That script didnt combine the files. This created seperate files by hourly based.
I prefer to combine "15 minutes generated two different files" "hourly in one file"
Just adding my 2 cents here.
Say you have the files a1.txt, b1.txt, c1.txt, d1.txt.
How about you try writing a script that performs the following operations:
1) Create a new file, say 1 and append the contents of each file into it:
cat a1 b1 c1 d1 > 1
2) Leave the 1 file intact and delete the other files:
rm *.txt
(or you can move them to a different directory)
Repeat the process for as long as you need, creating files with .txt extension every 15 minutes, then combining them into a file without extension, and then deleting the .txt files.
Hope it helps.
for i in 1 2 ; do for j in File$i*; do TGT=${j%????_*}0000_0000000$i; TGT=${TGT/[12]/3}; done; cat File$i* > $TGT; done
If files come in regularly, and you run this regularly, you'll need to either remove the quarter hourly files after cat ting, or make the j for loop somewhat more specific.