User Tools

Site Tools


howtos:combine_three_lines_into_one

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howtos:combine_three_lines_into_one [d/m/Y H:i] (current)
Line 1: Line 1:
 +By changing the number "​3"​ to something else you can make combine a different number of lines into one. Here are two examples:
  
 +<​code>​
 +awk '​ORS=NR%3?",":"​\n"' ​
 +
 +awk '{if (NR%3) {ORS="";​print " "$0} else {ORS="​\n";​print " "​$0}}'​
 +
 +</​code>​
howtos/combine_three_lines_into_one.txt · Last modified: d/m/Y H:i (external edit)