in reply to Parsing a table with variable columns on each line
orwhile (<>) { chomp; my @fields = split /\t/; for ( splice(@fields, 3) ) { print(join("\t", @fields, $_), "\n"); } }
while (<>) { (my $common, $_) = /^((?:[^\t]*\t){3})(.*)/; for ( split /\t/ ) { print("$common\t$_\n"); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing a table with variable columns on each line
by Anonymous Monk on Oct 23, 2009 at 16:32 UTC | |
by ikegami (Patriarch) on Oct 23, 2009 at 17:00 UTC | |
by Anonymous Monk on Oct 26, 2009 at 13:53 UTC |