Skip to content

Instantly share code, notes, and snippets.

@innermond
Created September 13, 2014 19:00
Show Gist options
  • Save innermond/b101a9f61a4f7acc3bcd to your computer and use it in GitHub Desktop.
Save innermond/b101a9f61a4f7acc3bcd to your computer and use it in GitHub Desktop.
A piece of sed code that rejoin words splitted by hyphens
/\-$/,/[^\-]$/{
:a
N
/\-$/ ba
s/\-\n+//g
}
@innermond
Copy link
Author

This is a sample text with hyphens
Janet Kendle had collapsed in hysterics and had
been given a knock-out pill. But her husband Sid
was still mooning about the place, getting in every-
one's way. The man seemed unable to control him-
self sufficiently to take to his own bed for an hour
or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment