-Michael#!/usr/bin/perl use strict; use warnings; my $fileName = $ARGV[0]; open (FILE, "<", $fileName); my $header = <FILE>; my @countArray = (); my @line; my @allTags; my %results; my $uniqueTag; my $one = "NO"; my $three = "NO"; while (<FILE>) { @line = split(" ", $_); $uniqueTag = $line[0] if @line > 1; if (@line == 2) { $three = "YES" if $line[1] == 3; $one = "YES" if $line[1] == 1; } if ((@line <2) || (eof)) { if (($three eq "YES") && ($one eq "YES")) { $results{$uniqueTag} = "GOOD"; } else { $results{$uniqueTag} = "BAD"; } push (@allTags, "$uniqueTag"); $one = "NO"; $three = "NO"; } } for (@allTags) { print STDERR "$_\t $results{$_}\n"; }
In reply to Re: validating file with perl
by mtmcc
in thread validating file with perl
by mmittiga17
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |