in reply to Shortcut to identify column numbers in a data file based on header
Looking for something like this?
use 5.010; my @headers = do { chomp($_ = <DATA>); split /\t/ }; while (<DATA>) { chomp; my %F; @F{@headers} = split /\t/; say $F{'N Total Depth'}; } __DATA__ Non-Syn Splice dbSNP N (Var Depth) N Total Depth N Freq + T (Var Depth) 1 0 0 0 34 0 11 1 0 0 0 54 0 14 1 0 0 0 42 0 11
|
|---|