Re: Search Tab-delimited file for Null fields

2004-12-01 Thread Lawrence Statton
John Krahn wrote: > Debbie Cooper wrote: > > my @empty = (); > > my @headings = (); > > Aggregate variables created with my() are empty by default so assigning an > empty list to them is redundant. > I hope I am not opening a can of worms by getting into a style disucssion, and I will preface t

RE: Search Tab-delimited file for Null fields

2004-12-01 Thread Debbie Cooper
needed. I'm liking this Perl stuff more and more. Thanks, Debbie -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 30, 2004 4:40 PM To: Perl Beginners Subject: Re: Search Tab-delimited file for Null fields Debbie Cooper wrote: > Thanks to ev

Re: Search Tab-delimited file for Null fields

2004-11-30 Thread John W. Krahn
Debbie Cooper wrote: 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 = (); Aggregate variables created with my() are empty by default so assigning an empty list to them is redundant. my $sum

Re: Search Tab-delimited file for Null fields

2004-11-30 Thread John W. Krahn
Jonathan Paton wrote: Dear All, Hello, Given the requirement that we are looking for unused columns, as soon as we have seen all columns we can exit. I would do: my %look_for; my @header = split /\t/, ; You don't chomp the input here which may foul up your output at the end. for my $column (0 ..

RE: Search Tab-delimited file for Null fields

2004-11-30 Thread Debbie Cooper
DEX "\n"; I do get a print of the empty indexes but not a real useful one. What am I doing wrong? Thanks, Debbie -Original Message- From: Chap Harrison [mailto:[EMAIL PROTECTED] Sent: Monday, November 29, 2004 11:48 PM To: Debbie Cooper Cc: [EMAIL PROTECTED] Subject: Re: Search

Re: Search Tab-delimited file for Null fields

2004-11-30 Thread Jonathan Paton
Dear All, Given the requirement that we are looking for unused columns, as soon as we have seen all columns we can exit. I would do: my %look_for; my @header = split /\t/, ; for my $column (0 .. $#header - 1) { $look_for{$column} = undef; } while () { chomp; my @data = split /\t/;

Re: Search Tab-delimited file for Null fields

2004-11-30 Thread John W. Krahn
Gunnar Hjalmarsson wrote: Debbie Cooper wrote: I'm trying to read through a tab-delimited text file with the first row containing headers. I want to print out any field/column name where the entire field is null (meaning there is no value for that field for any record in the file). I'm thinking

Re: Search Tab-delimited file for Null fields

2004-11-30 Thread John W. Krahn
Debbie Cooper wrote: I'm pretty new to Perl but with the help of this list I've been able to come up with a few helpful scripts. This time I'm trying to read through a tab-delimited text file with the first row containing headers. I want to print out any field/column name where the entire field i

Re: Search Tab-delimited file for Null fields

2004-11-30 Thread Lawrence Statton N1GAK/XE2
[EMAIL PROTECTED] (Debbie Cooper) writes: > I'm pretty new to Perl but with the help of this list I've been able to come > up with a few helpful scripts. This time I'm trying to read through a > tab-delimited text file with the first row containing headers. I want to > print out any field/column

Re: Search Tab-delimited file for Null fields

2004-11-29 Thread Chap Harrison
This time I'm trying to read through a tab-delimited text file with the first row containing headers. I want to print out any field/column name where the entire field is null (meaning there is no value for that field for any record in the file). [snip] I'm thinking that if I read each column int

Re: Search Tab-delimited file for Null fields

2004-11-29 Thread Gunnar Hjalmarsson
Debbie Cooper wrote: I'm trying to read through a tab-delimited text file with the first row containing headers. I want to print out any field/column name where the entire field is null (meaning there is no value for that field for any record in the file). I'm thinking that if I read each column