1

awk count fields not working

view story
linux-howto

http://www.unix.com – Hi, i am trying to count the fields in a file. Input: Code: 100,1000,,2000,3000,10/26/2012 12:12:30 200,3000,,1000,01/28/2012 17:12:30 300,5000,,5000,7000,09/06/2012 16:12:30 output: Cout of the fileds for each row Code: 6 5 6 Code: awk -F"," '{print $NF}' file1.txt When i try with above awk command i am getting the below output and it is not working as expected. Code: 12:12:30 17:12:30 16:12:30 Any suggestion using awk command for couting the fields. (HowTos)