Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am using the following code to try and determine if a column has any data other then 0
I know have a hash of row data, How can I determine if the entire column consists of zero data?#!/perl/bin/perl.exe -w use strict; my @array = (); my @row = (); my %hash = (); if ( @ARGV != 1 ) { print "\nUsage: <File Name> \n\n"; exit(0); } my $file = $ARGV[0]; open (FILE, $file) || die "ERROR: Unable to open $file :$!\n"; @array = <FILE>; my $size = @array; for (0..$size) { @row = (split /\;/, $array[$_]); $hash{$_} = \@row; foreach (@row) { print $_, "\n"; } @row = (); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding Empty Columns
by demerphq (Chancellor) on Feb 14, 2003 at 20:49 UTC | |
by Anonymous Monk on Feb 14, 2003 at 21:01 UTC | |
by demerphq (Chancellor) on Feb 14, 2003 at 21:32 UTC | |
|
Re: Finding Empty Columns
by l2kashe (Deacon) on Feb 14, 2003 at 20:00 UTC | |
|
Re: Finding Empty Columns
by jdporter (Paladin) on Feb 14, 2003 at 20:12 UTC | |
by Anonymous Monk on Feb 14, 2003 at 20:48 UTC | |
by jdporter (Paladin) on Feb 14, 2003 at 21:17 UTC |