Skip to content

Instantly share code, notes, and snippets.

@mizzy
Created April 11, 2012 02:18
Show Gist options
  • Select an option

  • Save mizzy/2356435 to your computer and use it in GitHub Desktop.

Select an option

Save mizzy/2356435 to your computer and use it in GitHub Desktop.
#!/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