Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
Created August 10, 2011 16:15
Show Gist options
  • Save terrancesnyder/1137303 to your computer and use it in GitHub Desktop.
Save terrancesnyder/1137303 to your computer and use it in GitHub Desktop.
Sed Replace in Text with Groups
# find any date and append T00:00:00Z to it
echo "01-01-2001,asd,01-01-2001" | sed 's/\([0-9]\+-[0-9]\+-[0-9]\+\)/\1T00:00:00Z/g'
@terrancesnyder
Copy link
Author

# In all files
sed -i 's/\([0-9]\+-[0-9]\+-[0-9]\+\)/\1T00:00:00Z/g' *.csv

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