Perl: How to get awk output from variable -
Perl: How to get awk output from variable -
i getting syntax error awk.
value = a|b|c|d|e|f|g|h $record = `$value | awk -f "|" '{print $5}'`;
thanks,
if you're ever tempted phone call awk perl you're doing wrong. perl can pretty much awk can - , more efficiently , more portably.
my $value = 'a|b|c|d|e|f|g|h'; $record = (split /\|/, $value)[4]; # 4, not 5 perl arrays zero-indexed
perl
Comments
Post a Comment