Help with for/if/else print statements

{for(i in b){if(b-1&&a!=b){print i";\t\t"b}else{print "NEW:"i";\t\t"b} } }

what I need is to just print

else{print "NEW:"i";\t\t"b

and not print

{print i";\t\t"b}

how do i get awk to not print the first bit? is there an ignore statement although i still need awk to use this statement for the calculation in

else{print "NEW:"i";\t\t"b

if you understand the logic

Just remove the code from the fist part:

{for(i in b){if(b-1&&a!=b){}else{print "NEW:"i";\t\t"b} } }
1 Like

great it works, I was missing the

{}

---------- Post updated at 08:56 PM ---------- Previous update was at 08:55 PM ----------

any chance you could answer my other post

http://www.unix.com/shell-programming-scripting/178825-compare-print-lines-2-requirements.html