Adding a delimiter to a variable length file

view story

http://www.unix.com – Hi, I'm new to unix, i have a variable length file like below, Code: 01|Test|Test1|Sample| 02|AA|BB|CC|DD| 03|AAA|BBB|CCC|DDD|EEE|RRR|TTT|SSS|YYY| I need to make this as a fixed length file. Assume that i have 10 columns in the DAT file. for ex: the first 01 record is having 4cols - there i need to add six "|" delimiter and for 02 record need to add five delimiters. Like wise i need to read few record number and add the delimiter correspondingly.. Can anyone help me on this regard. your help would be much appreciated.. Thanks in advance, Mohankumar.V (HowTos)