in reply to Add leading zeros to days/months in dates while parsing CSV
$_ = sprintf '%04d-%02d-%02d', (split m:/:)[2, 0, 1] for @fields[10, 1 +4, 24, 26];
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; my @fields = 'a' .. 'z'; @fields[ 10, 14, 24, 26] = ('1/2/2016') x 4; $_ = sprintf '%04d-%02d-%02d', (split m:/:)[ 2, 0, 1 ] for @fields[ 10 +, 14, 24, 26 ]; say join ',', @fields;
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Formatting dates while parsing CSV
by BigRedEO (Acolyte) on Jun 14, 2016 at 14:35 UTC | |
by Corion (Patriarch) on Jun 14, 2016 at 14:44 UTC | |
by BigRedEO (Acolyte) on Jun 14, 2016 at 15:16 UTC | |
by choroba (Cardinal) on Jun 14, 2016 at 15:35 UTC | |
by BigRedEO (Acolyte) on Jun 14, 2016 at 15:50 UTC | |
| |
by choroba (Cardinal) on Jun 14, 2016 at 15:25 UTC | |
by BigRedEO (Acolyte) on Jun 14, 2016 at 15:26 UTC |