How to print selected fields

HI,

I am using below command to display the words, but i am getting awk error. Please help me out on this

I am using below code

i am getting error as

If i use below code i am getting below OP
Output from where i am trying to select the fields after delimiter ","

from here i want to select 1,2, and 3rd fields after ","

 | awk -F, '{print $1,$2,$3}'

Unless there is no syntax error in the awk statement this error is due to incompatible awk your trying to invoke. Try with nawk instead of awk nawk -F,'{ print $1 ...
Also post the OS your using

@balajesuri: Its working thanks...
@michael: i tried it but no luck :frowning: i am using OS sol5.9

Try /usr/xpg4/bin/awk instead of nawk

Jean-Pierre.

you can use dis simply

awk -F"," '{print $1,$2,$3}'