in reply to text processing - convert list of vectors to tabular format

Another one.
use strict; undef $/; my $data = <DATA>; my (%hash, @chars) ; my $count = 0; foreach (split("\n", $data)) { push @chars , $1 if $_ =~ m/^v_((.*)) {/ ; # Thanks Anonymous Monk-- } foreach (@chars) { @{$hash{$_}} = split( "\n", $1) if $data =~ m#v_$_ \{([^\}]+)\}#; $count = ($count > @{$hash{$_}}) ? $count : @{$hash{$_}} ; } for my $c (0..$count) { print ${@{$hash{$_}}}[$c] ."\t" foreach ( @chars ); print "\n" ; }
Thanks..

Replies are listed 'Best First'.
Re^2: text processing - convert list of vectors to tabular format
by Anonymous Monk on Dec 15, 2005 at 18:12 UTC
    Why do you split $1 on "{"? $1 does never contain a "{". Or am I mistaken?