Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • awk '{ORS=NR%2?",":"\n"};1' is shorter and more idiom Commented Aug 29, 2015 at 1:48
  • @cuonglm, i doubt it. In this instance it's still a one-liner despite the print and the intent is clear. 1 is just as clear to old awk hands such as myself but I prefer print Commented Aug 29, 2015 at 2:09
  • This was the first simple solution that I found that was easily configurable to more than 2 lines. I fought with sed for a while before searching, but awk made combining every 4 lines easier. Saved me a trip to the $EDITOR! Commented Feb 26, 2016 at 17:37