Operating System - HP-UX
1837883 Members
3446 Online
110122 Solutions
New Discussion

Re: Awk scripting problem - columns

 
SOLVED
Go to solution
Luke Morgan
Frequent Advisor

Re: Awk scripting problem - columns

I have tried the revised script and it works the same
as the previous one in that it gives the right data in
the right format except that
all negative values become positive.

What do you mean when you say
"given that columns cannot be negative" ?

Is it not possible to have a negative number in the data
that is still negative once it has gone through the perl
script ?

Luke
H.Merijn Brand (procura
Honored Contributor

Re: Awk scripting problem - columns

Oops, too greedy.

for a in `ls` ; do
echo processing $a ...
perl -nle'/(\d+)\D+?(-?\d+)/&&$1 and$x[$1-1]=$2}END{$,="|";print@x'$a >$a.res
done

I mean that it would be non-logical to use negative column indices. The revised version accepts negative column data, but not negative column numbers
Enjoy, Have FUN! H.Merijn
Luke Morgan
Frequent Advisor

Re: Awk scripting problem - columns

Spot on.
Thank you very much again!

Luke