S
shadkeene
Hi,
Here's a complete but minimal example of what I'm doing with a .csv
file (each line in the .csv file corresponds to a certain date).
I'm reading the file and printing out simple statistics for the data
using the grep command. However, I'd like to go a step further and
print the date if a certain thing (or combination of things) occurred
on that day. (i.e. if checkboxes WF and CF were checked...print the
date that they were checked).
My desperate but not functional attempt to correlate the values, line
by line, and place in an array is at the bottom. Thanks for any help!
Shad
open(FH, "C:/perl-scripts/Data/coldseasonworksheet.csv")
or &dienice("couldn't open output file: $!");
seek(FH, 0, SEEK_SET); #goes to beginning of file
my @data = <FH>; #reads file and places in array
close(FH);
my @ETresults = grep(/ET,/, @data);
my $ETnum = @ETresults;
Exiting Troughs this year=$ETnum. <br>
#my @output = (); ###attempt...tried to use "and", "||" so the "||"
would be read first.
#push @output, param('DATE') and param('WF') || param('CF') for
@fields;
Here's a complete but minimal example of what I'm doing with a .csv
file (each line in the .csv file corresponds to a certain date).
I'm reading the file and printing out simple statistics for the data
using the grep command. However, I'd like to go a step further and
print the date if a certain thing (or combination of things) occurred
on that day. (i.e. if checkboxes WF and CF were checked...print the
date that they were checked).
My desperate but not functional attempt to correlate the values, line
by line, and place in an array is at the bottom. Thanks for any help!
Shad
open(FH, "C:/perl-scripts/Data/coldseasonworksheet.csv")
or &dienice("couldn't open output file: $!");
seek(FH, 0, SEEK_SET); #goes to beginning of file
my @data = <FH>; #reads file and places in array
close(FH);
my @ETresults = grep(/ET,/, @data);
my $ETnum = @ETresults;
Exiting Troughs this year=$ETnum. <br>
#my @output = (); ###attempt...tried to use "and", "||" so the "||"
would be read first.
#push @output, param('DATE') and param('WF') || param('CF') for
@fields;