I am looking to print the data in columns and after every 3 words it should be a new row.
cat example.out | awk 'END { for (i = 0; ++i < m;) print _;print _[0] }{ _[NR % m] = _[NR % m] x ? _[NR % m] OFS $1 : $1}' m=1| grep -i INNER
I am looking to print in a new line after every 3 words.
How can i change the above code to my requirement
Thank You
Lazy Dev
---------- Post updated at 05:58 PM ---------- Previous update was at 03:52 PM ----------
This command worked for me :-
awk '{printf("%s",NR%3 ? $0"\t":$0"\n")}' example.out