John Doe am Mittwoch, 18. Januar 2006 15.30:
[...]
> Another way (I don's say a better :-) ) could be not using a data
> structure, but doing the transformation on the fly:
>
> - read a line of the input data
> - record the first or a new field name while scanning (id001 etc.)
> - if the field name is new / has changed, output it to a new file
> - if it is not new / has not changed, append the value(s)
> - repeat these steps

open input file and new output file

read a line of the input data and record the field name (id001 etc.)

if the field name is new / has changed, output a newline (exept for the first 
line), the field name and the value.
if it is not new / has not changed, output only the value.

read next line from input file and repeat procedure

close files

joe

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to