Using awk (or sed) to remove newlines based on first character of next line

前端 未结 5 2054
陌清茗
陌清茗 2021-02-15 14:23

here\'s my situation: I had a big text file that I wanted to pull certain information from. I used sed to pull all the relevant information based on regexp\'s, but each \"piece\

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-15 14:42

    sedsed -d -n ':t;/^,/!x;H;n;/^,/{x;$!bt;x;H};x;s/\n//g;p;${x;/^,/!p}' filename
    

提交回复
热议问题