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 ArticleAnswer 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 ArticleCount 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 ArticleAnswer by Kusalananda for Count the maximum character length for all the data...
Using Miller (mlr) to calculate the max length of each field's values. The input is read as CSV, and the output is produced as an "xtab" file (one key+value pair on each):$ mlr --c2x stats1 -a maxlen...
View ArticleAnswer by jubilatious1 for Count the maximum character length for all the...
Using Raku (formerly known as Perl_6)~$ raku -ne 'BEGIN my @a; unless ++$ == 1 { @a.push: $_.split(",").map: *.chars; }; END say( ++$ ~ " | " ~ $_ ) for ([Z] @a).map: *.max;' fileOR:~$ raku -ne 'BEGIN...
View Article