Skip to content

Instantly share code, notes, and snippets.

@thegeorgeous
Last active April 18, 2017 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thegeorgeous/df1c8c0af892a15e259145216436d206 to your computer and use it in GitHub Desktop.
Save thegeorgeous/df1c8c0af892a15e259145216436d206 to your computer and use it in GitHub Desktop.
Useful Sed Scripts
# Replace multiple whitespaces with a comma
# Example:
# Convert dig answer output into a CSV
sed -i -e 's/ \{1,\}/,/g' file
# Add a character at the end of a file
# Example add comma to the end of a line
sed -i -e 's/$/|/g' abc.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment