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.

Required fields*

3
  • 1
    Alternatively you could use sed on its own without paste: sed -r 'N;s/\n(\w+)/\1&/;P;D' somefile.txt Commented Jan 13, 2017 at 0:19
  • 1
    If you write sed programs for fun, then perhaps you should have a go at code-golf ;-) Commented Jan 13, 2017 at 0:34
  • 1
    @DigitalTrauma she's been on code-golf for 2 month already ;) Commented Jan 13, 2017 at 3:43