Monday 15 December 2008

Some handy awk one liners

Print the length of the longest input line:

awk '{ if (length($0) > max) max = length($0) } END { print max }' data

No comments:

Post a Comment

Tweets by @sriramperumalla