The script below displays the largest number of fields in twister.txt.
awk '{if (NF > max) max = NF} END{print max}' twister.txt
My question is, How do you display the line itself, which has the largest number of fields in twister.txt.
awk '{if (NF > max) {max = NF; line=$0}} END{print line}' twister.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With