Quantcast
Channel: Count the maximum character length for all the data fields in a simplified csv file and output to txt - Unix & Linux Stack Exchange
Browsing all 3 articles
Browse latest View live

Answer by G-Man for Count the maximum character length for all the data...

If I understand your question correctly, this will do what you want: awk -F, 'NR!=1 { if (max_NF < NF) max_NF = NF; for (i=1; i<=NF; i++) if (max[i] < length($i)) max[i] = length($i) } END {...

View Article



Answer by Raza for Count the maximum character length for all the data fields...

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 = "," } ; {...

View Article

Count the maximum character length for all the data fields in a simplified...

Given a simplified CSV (max one line per row) with many data fields (>50), how can I count the maximum character length for each data field and then export all the counts to a txt file? BTW, I want...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images