vanuatu10 has asked for the wisdom of the Perl Monks concerning the following question:
If the data between "Ent" and "Tester" are different as far as having one or two entries, how can I make the entries equal two and so on by adding new lines followed by commas. Each record in the file may have more than one entry between "Ent" and "Tester." If one record in the file has one entry between "Ent" and "Tester", and the others have eight, two, three,..... How would I alter each record with new lines to have the same number of lines. In the above case, the highest number would be two; but this could be higher in the file I have.Ent, Name, SC011, BUN, Tester, Value, #1008 Ent, Name, FS0022L, FUN, TL0324, PLEASE, Tester, Value, #1002 Ent, Name, SC004, TAKE, K530, RUN, Tester, Value, #1001
Example of output:
Please help!Ent, Name, SC011, BUN, , Tester, Value, #1008 Ent, Name, FS0022L, FUN, , TL0324, PLEASE, Tester, Value, #1002 Ent, Name, SC004, TAKE, K530, RUN, Tester, Value, #1001
Edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Equal line spacing in records of a file
by vladb (Vicar) on May 22, 2002 at 15:13 UTC | |
|
Re: Equal line spacing in records of a file
by jmcnamara (Monsignor) on May 22, 2002 at 15:25 UTC | |
by vanuatu10 (Initiate) on May 24, 2002 at 13:54 UTC | |
by merlyn (Sage) on May 24, 2002 at 14:32 UTC | |
by dada (Chaplain) on May 24, 2002 at 14:36 UTC | |
by mrbbking (Hermit) on May 24, 2002 at 15:01 UTC | |
|
Re: Equal line spacing in records of a file
by Mask (Pilgrim) on May 22, 2002 at 14:52 UTC |