awk Division and modulus

I need to read the file divide 3 column with 2nd and run a modulus of 10 and check whether the remainder is zero or not if not print the entire line.

cat filename | awk '{ if ($3 / $2 % 10 != 0) print $0}'

Whats wrong with it ?

You are probably just missing brackets around the ($3 / $2) part.

You can do this more simply, though:

awk '($3 / $2) % 10' filename

Ok its sorted now

cat $FILE | awk '{if ($3/$2 % 10 != 0)  {print} }' | awk '{print $1 , $4 , $5}'

But the values in column 4 , 5, 6 , 7, 8 are are seperated by spaces and awk treates them as different values

Example
ABC OP OPPO NOP

The problem is the no is not consistent so it might contain some more character with more spaces like

ABC OP OPPO NOP OP JHIJ

I need them to be treated as I column

The use of cat is redundant, it's sufficient to use one awk command to get your output IMHO.

Post your input file and the desired output.

input File

COL1                         COL2                         COL3                         COL4
USGDQ0910MJT       46.00000000           49.000000000000000 PUT  ABC JAN 10   46.0  ABC SCIENCES INC          
COL5
PUT  OP JAN 10   49.0     ABC SCIENCES INC    

Need COL1, COL2, COL3, COL4,COL5

---------- Post updated at 05:44 PM ---------- Previous update was at 04:37 PM ----------

cat FILE| awk '{if ($3/$5 % 10 != 0)  {print $0} }' | awk 'BEGIN { OFS="," } -F" " {print $1,$2,$3,$4,$5}'

But all records are shown on same line , how does records on new line