Thanks to everyone for their help on this problem. I finally ended up using the following: #!perl use warnings; use strict;
my @empty = (); my @headings = (); my $sum; open INDEX, "> fieldcontents.txt" or die "can't create fieldcontents.txt $!"; open INPUT, "<lv1.txt" or die "can't open data file: $!"; { while (<INPUT>) { if ($. == 1) { chomp; # remove newline @headings = split /\t/; # get each of the headings @empty = @headings; } next if $. == 1 ; chomp; # remove newline my @fields = split /\t/; # get each of the fields for (my $i = 0; $i <= $#fields; $i++) { if (length($fields[$i]) >= 1) { #look for fields with no value $empty[$i] = ""; #assign flag to new array } } } foreach (@empty){ if( $_ ){ print INPUT "$_\n"; } } close INPUT; } close INDEX; This does what I want for now but I'm still learning so I'm sure I'll be adding to it. Please ignore my second post to the list -- I was feeling kind of brain dead at the time. Thanks, Debbie -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>