Concatenating every other line with the next

后端 未结 5 1226
醉话见心
醉话见心 2020-12-14 15:11

In a text document I want to concatenate every other line with the next. I guess sed is the thing to use? How would this be done?

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 15:43

    This is easiest using paste:

    paste -s -d' \n' input.txt 
    

    Although there's a Famous Sed One-Liner (38) to emulate this as in potong's answer.

提交回复
热议问题