Thanks a lot for this post. I went back and checked
Here is what the contents of the error file look likeJust to check that the array @sample_ids contains the actual ids I printed the contents of the sample id' and got the following************************************** Errors for file: Merged_CSVfiles_1.txt ************************************** Sample_identifier 11SS00342 / IRD Clinic clinic_HIV000140180: * The following fields contain invalid values: Blah blah blah blah * Sample_identifier 11SS00336 / IRD Clinic clinic_HIV000140174: * The following fields contain invalid values: Yada yada yada * Sample_identifier 11SS00303 / IRD Clinic clinic_HIV000140141: * The following fields contain invalid values: yeah yeah yeah
I get the following output which is the list of the ID's (this is just a truncated list, just 8 of the 438 errors) UCD11-02580-V UCD11-02581-P UCD11-02581-V UCD11-02583-P UCD11-02583-V UCD11-02584-P UCD11-02584-V UCD11-02585-P I also did the following as a checkpush(@sample_ids,$line); print(@sample_ids);
push(@sample_ids,$line); }# End of the if loop }#End of the for-each loop print $sample_ids[3];
and I got: 11SS00304
What I did realized though was that:foreach my $records (@merged_array) { my @elements = split /,/, $records; print $elements[0];
The Output from this was: "John Doe"John Doe"John Doe"John Doe"John Doe
I realized that some of the fields themselves had commas within and that I couldn't consistently get the field I wanted by "print18" in this case
In reply to Re^2: Why is the following instance of Matching using an array element not working
by MyJeweledPerls
in thread Why is the following instance of Matching using an array element not working
by MyJeweledPerls
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |