Copying lines from multiple logfiles, based on content of the line

d df d d

Your FOR /f construct smells like windows, doesn't it?
Anyway, given your base info, you could create a long stream of all the log files with cat , and then use awk to distribute the lines across new files:

cat file0?.log | awk -F"[ :]" '$2!=fnum{fnum=$2} {print>"file"fnum"hr"}'

resulting in

file20hr
file21hr
file22hr

to be created.