Hello all,
I'm making progress on my first awk script in a LONG time.
I'm trying to now make it a bit more versitile...and send in file names as variables on the command line, rather than hard coded in, but I'm having problems.
Example...this works
BEGIN {
FS="|";
OFS="|";
while (getline <...
Ok...I think I solved this one.
Not exactly sure what happened...the hard coding of the values in the array read never worked...BUT, when I put in some real values that matched in the bxm_array[$2,$8] section...it started returning meaningful values.
So, SOLVED on this one..
Thank you,
CC
Without seeing your input data it's a bit difficult to answer.
A few comments on the code though; no need for split when you have defined the FS, even with getline awk will split the fields for you automatically.
Also, why assign things to variables unnecessarily. The existing code can be...
Hi all,
I'm trying my hand at awk again, but just can't seem to get things going. I'm starting this to try to load one file into a 2x dimensional array, and in the body, search it to match on fields of the file I'm processing and append some values for output.
This is in the early...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.