jalopez453 has asked for the wisdom of the Perl Monks concerning the following question:
I have script to where I am looking to update a date format, but for some reason my new file is not being created and I cannot see what I am missing or what is wrong. If someone could point out what I have wrong it would be truly appreciated.
use strict; open(INFILE, "PSR_Date.txt"); open(OUTFILE, ">PSR_OutputDate.txt"); while (<INFILE>) { $line = $_; $line =~ s/(\d{4})-(\d{2})-(\d{2})\s\d{2}:\d{2}:\d{2}/ +\2\/\3\/\1/g; print OUTFILE "$line"; } close INFILE; print "Done!\n"; chomp($pause = <STDIN>); _DATA_ OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,2015- +06-20 00:00:00 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,2015- +06-20 00:00:00 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,2015- +06-20 00:00:00 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,2015- +06-20 00:00:00 _OUTPUT_ OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,06/20 +/2015 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,06/20 +/2015 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,06/20 +/2015 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,06/20 +/2015
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: New File Not Working
by Corion (Patriarch) on Jan 24, 2020 at 17:33 UTC | |
by jalopez453 (Acolyte) on Jan 24, 2020 at 17:49 UTC | |
by haukex (Archbishop) on Jan 24, 2020 at 17:57 UTC | |
|
Re: New File Not Working
by Fletch (Bishop) on Jan 24, 2020 at 17:35 UTC | |
|
Re: New File Not Working
by talexb (Chancellor) on Jan 24, 2020 at 17:46 UTC | |
|
Re: New File Not Working
by AnomalousMonk (Archbishop) on Jan 24, 2020 at 19:42 UTC | |
|
Re: New File Not Working
by GrandFather (Saint) on Jan 25, 2020 at 01:16 UTC |