in reply to printing column info without headers
Your while is going to read the whole file. Inside that loop, the if you currently have will operate on the headers. If you want to operate also on the lines that are not the headers, add an else to that.
while (<FILE>) { if (/^Number1/) { # header } else { # non-header } }
If you happen to have a data line that begins with 'Number1', however, it's going to treat that as a header. It might be better to read the file this way:
open ... my $header_line = <FILE>; while (<FILE>) { # data line }
Considering the format of your data, it might be easiest to use something like Text::CSV_XS.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: printing column info without headers
by annie06 (Acolyte) on Jul 09, 2008 at 15:28 UTC | |
by almut (Canon) on Jul 09, 2008 at 16:10 UTC | |
by planetscape (Chancellor) on Jul 10, 2008 at 14:07 UTC |