Skip to end of metadata
Go to start of metadata
#! /usr/bin/perl
#
#use strict;
#use warnings;
#
#
#

open(FILE, $ARGV[0]);

print "File: ".$ARGV[0]."\n";
my $max = 0;
while(my $line = <FILE>) {
   $line=~ s/\n$//;
   my @cols = split('\t', $line);
   my $current = scalar @cols;
   if($current != 3) {
        die $line." has more than three columns";
   }
   if($cols[0]!~ /^[\w\_]+$/) {
        die "'".$line."' has no valid column 0 ".$cols[0];
   }
   if($cols[1]!~ /^\w\d\d$/) {
        die "'".$line."' has no valid column 1 ".$cols[1];
   }
   if($cols[2]!~ /^\d+$/) {
        die "'".$line."' has no valid column 2 ".$cols[2];
   }
}

  • No labels