program in loop.

eg: sample.dat

21111111110000652 B86860003OLFXXX0000001_20081227
21111111110000652 B86860003ODL-SP0000002_20081227
21111111110000652-B94030001ODL-CH0000003_20081227
22222222220000653-B94030001OLFXXX0000011_20081227
23333333330000654-E71060001OLFXXX0000012_20081227
24444444440000655 E71060002OLFXXX0000014_20081227
24444444440000655 E71060002ODL-SP0000015_20081227
.....
.....

I Want to write a program in ksh script in such a way (while read line do) that the out txt file should look like below

outfile.txt

21111111110000652 B86860003OLFXXX000000120081227 0000002 0000003
22222222220000653-B94030001OLFXXX000001120081227
23333333330000654-E71060001OLFXXX000001220081227
24444444440000655 E71060002OLFXXX000001420081227 0000015

thx

What is the algorithm to transform the input to the output?

What do you have to do to it?

Hi.

Is there any chance you might tell us where 0000002, etc. might come from?

Pls read my earlier posting on this.

Sorry. I didn't realise that this was a double post!!

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.