Skip to content

Instantly share code, notes, and snippets.

@vadimkantorov
Created January 30, 2024 18:33
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 vadimkantorov/9f29baaf91827c6fe8bfe9ca05b3ace8 to your computer and use it in GitHub Desktop.
Save vadimkantorov/9f29baaf91827c6fe8bfe9ca05b3ace8 to your computer and use it in GitHub Desktop.
Various sed tricks
# excel opens correctly only utf16 with BOM with tab separator or utf8 with bom with comma separator
sed '1s/^\(\xef\xbb\xbf\)\?/\xef\xbb\xbf/' will_prepend_bom_to_utf8_file_if_it_does_not_have_bom_yet.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment