Skip to content

Instantly share code, notes, and snippets.

@verajosemanuel
Last active November 14, 2017 09:31
Show Gist options
  • Save verajosemanuel/a352f2795428dbaac672d4727ecc4fe0 to your computer and use it in GitHub Desktop.
Save verajosemanuel/a352f2795428dbaac672d4727ecc4fe0 to your computer and use it in GitHub Desktop.
#sed insert newline between negative + positive pattern #bash #regex
sed -r 's/([^.] )(WORD\. )/\1\n\2/g'
# sample
NOTNEEDED. WORD. 8 de 2007/04/12 Definitiva
1ª Conferencia mundial en londres WORD. 3901 de 2009/10/01 UTC
# output
NOTNEEDED. WORD. 8 de 2007/04/12 Definitiva
1ª Conferencia mundial en londres
WORD. 3901 de 2009/10/01 UTC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment