in reply to Re: Why is the following instance of Matching using an array element not working
in thread Why is the following instance of Matching using an array element not working
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Why is the following instance of Matching using an array element not working
by Kenosis (Priest) on Aug 10, 2012 at 20:31 UTC | |
by MyJeweledPerls (Initiate) on Aug 10, 2012 at 23:03 UTC | |
by Kenosis (Priest) on Aug 11, 2012 at 05:53 UTC | |
by MyJeweledPerls (Initiate) on Aug 13, 2012 at 21:22 UTC | |
by Kenosis (Priest) on Aug 13, 2012 at 21:29 UTC |