Quantcast
Viewing latest article 2
Browse Latest Browse All 5

Answer by Raza for Count the maximum character length for all the data fields in a simplified csv file and output to txt

I don't see your link for the sample file but you can do this by using awk command. if can specify what ever delimiter you may have and exactly what field you need to count.

    awk '{ FS = "," } ; { if(NR!=1) gsub(/"/, "", $2) ; print NR "|" length($2) } ' test.csv

You can redirect this output to any file you want.


Viewing latest article 2
Browse Latest Browse All 5

Trending Articles