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