while($line = <$FH>) { # split the fields, concatenate the first three fields, # and add it to the beginning of each line in the file chomp($line); my @fields = split(/,/, $line); unshift @fields, join '_', @fields[0..2]; $_ = join '-', (split /\//)[2,0,1] for $fields[14]; $_ = join '-', (split /\//)[2,0,1] for $fields[20]; $_ = join '-', (split /\//)[2,0,1] for $fields[23]; $_ = Time::Piece->strptime($fields[38],'%m/%d/%Y %H:%M')->strftime('%Y-%m-%d %H:%M'); $_ = Time::Piece->strptime($fields[39],'%m/%d/%Y %H:%M')->strftime('%Y-%m-%d %H:%M'); push @data, \@fields; } #### while($line = <$FH>) { # split the fields, concatenate the first three fields, # and add it to the beginning of each line in the file chomp($line); my @fields = split(/,/, $line); unshift @fields, join '_', @fields[0..2]; $_ = join '-', (split /\//)[2,0,1] for $fields[14,20,23]; $_ = Time::Piece->strptime($_,'%m/%d/%Y %H:%M')->strftime('%Y-%m-%d %H:%M') for @fields[38,39]; push @data, \@fields; }