Reply-to: "Perl Mongers of Omaha, Nebraska USA" <omaha-pm@pm.org>
Thread-index: AceQyoGfZqVsiDl0QLO0WhsAZDqRvg==
Thread-topic: Convert date formats in text files
Project:
For all text files in a directory, change all instances of "YYYY-MM-DD
HH:MM:SS" to "YYYYMMDD".
Solution:
perl -pi -e 's/(\d\d\d\d)-(\d\d)-(\d\d) \d\d:\d\d:\d\d/$1$2$3/g' *.txt
j