Skip to content

Instantly share code, notes, and snippets.

@matthewrmshin
Last active January 6, 2020 14:54
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 matthewrmshin/c3e25e57a0cadd91b5d53e854076c63f to your computer and use it in GitHub Desktop.
Save matthewrmshin/c3e25e57a0cadd91b5d53e854076c63f to your computer and use it in GitHub Desktop.
Convert YYYYMMDDhhmm to YYYY-MM-DD hh:mm:00 in column 1
#!/usr/bin/sed -f
# To use:
# 1. Download or copy this script.
# 2. Save it in a suitable location. E.g. ./datetime.sed
# 3. Ensure this script is executable.
# 4. Run: ./datetime.sed IN-FILE > OUT-FILE
s/^\([0-9]\{4\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)/\1-\2-\3 \4:\5:00/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment