Saturday 16 May 2009

using multiple delimiter in awk

I have text like this:
cat my_details :

"125"|"raghu"|"grep"
"125"|"sriram"|"ms"
"450"|"khanna|"nokia"
"451"|""hari"|"maxplore"

expected output : get only lines whose first field is equal to 125 :

awk -F "[\",|]" '$2==125' my_details

No comments:

Post a Comment

Tweets by @sriramperumalla