[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] 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