Created
April 18, 2012 16:15
-
-
Save tricker/2414640 to your computer and use it in GitHub Desktop.
Simple csv file parser, takes infile, adds a time where appropriate, writes to outfile. All should reside in the same directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
open INFILE, "fin2_tran.csv" or die $!; | |
open OUTFILE, ">fin2_out.csv" or die $!; | |
while (<INFILE>) { | |
s/,(\d{4}-\d{2}-\d{2})(,[^,]+$)/,"$1 11:00:00"$2/; | |
print OUTFILE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment