Hey all,
I'm trying to open a text file, collect the file into an array called
@records. Then I'm going to write the data back out to another text file
based on a variable such as:
$sfield and $var are fed from an HTML doc.

If ($sfield == 1) {
>>open (INFILE, "<mytext.txt")
>>              or die "Error opening mytext.txt. $!, stopped";
>>      @records = <INFILE>;
>>      close(INFILE);
>>      foreach my $rec (@records) {
>>              $w = $x++;
>>              chomp($rec);
>>              ($val, $val1, $val2, $val3) = split(/,/, $rec);
>>      if ($var == 1) {
>>              open (OUTFILE, ">mytext2.txt")
>>                      or die "Error opening mytext2.txt. $!, stopped";
>>              **comparison that looks for ($val == "Ronald")****
>>              **second array built only with records that match
criteria***
>>              **only those records written back out to the new text
file***
>>      }
>>      if ($var == 2) {
>>              open (OUTFILE< ">mytext3.txt")
>>      }
>>} #and so on....

Any assistance would be greatly appreciated.

Thanks,
Mark



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to