Count Fields with Quoted Field

view full story

http://www.unix.com – Hi, I used to count number of fields using following command HTML Code: head -1 <filename> | awk -F"," '{print NF}' Now the scenario is the delimiter(comma) occurs inside one of the data field. How to ignore the comma inside data and consider only delimiter and count number of fields. The fields are enclosed in double quotes. Example: "1","FirstName,LastName","City" (HowTos)