I need to read a file which is like
5200....
622...
710.....
712....
715....
627...
622...
710...
I need to check for batch header which is record 5 (starting from 5 ) then within that I need to check for detail reocrd 6
if it is not followed by addenda record 7 then I need to write that detail record 6 into a new file and rest in a different file.
Could you please help me how to do that.