Thanks cpjust.
and yes, it's a big mess.
well, the input looks like the sample in my previous post (v4 sample).
the following is a sample output:
200602,3122,000-005,305,U,4
200602,3122,000-005,305,M,57
200602,3122,000-005,305,I,5
200602,3122,000-005,305,F,220
200602,3122,000-005,305,C,1...