Created
April 11, 2012 02:18
-
-
Save mizzy/2356435 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/env perl | |
| use strict; | |
| use warnings; | |
| use Text::ASCIITable; | |
| my $t = Text::ASCIITable->new; | |
| my @lines = <STDIN>; | |
| my $heading = shift @lines; | |
| chomp $heading; | |
| $t->setCols(split '\t', $heading); | |
| for my $line ( @lines ) { | |
| $line =~ s/(20\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\t/$1-$2-$3 $4:$5:$6\t/g; | |
| $line =~ s/(20\d{2})(\d{2})(\d{2})\t/$1-$2-$3\t/g; | |
| $t->addRow(split '\t', $line); | |
| } | |
| print $t; | |
| exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment