I have a file with 20,000 dates in it that I need to convert and save back to a file. The dates are the only thing in the file and they are on separate lines.
This is what they are not
2011-01-03T16:44:09Z
and this is what I need
2011-01-03 12:34:00
If you have Ruby in your system, you can create a file like this:
date_parser.rb
Then you just run
$ ruby date_parser.rb
All you new dates will be in “new_dates.txt”
This script assumes you have a file “old_dates.txt” with each date in a different line.