Fish.
my %rec = ( cuid => "EMPTY" ); scalar <>; # eat first seperator line. while( <> ) { chomp; if( /^-+$/ ) { print "$rec{username}:$rec{name}:$rec{cuid}\n"; %rec = ( cuid => "EMPTY" ); } else { my( $k, $v ) = split( /:\s*/, $_, 2 ); $rec{ lc $k } = $v; } }
Update: Missed the part about the default.
In reply to Re: Transpose the entries
by Fletch
in thread Transpose the entries
by iqbala
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |