There is a class available HERE that you can use to output a specific column to either an array of values, or comma separated string.
Look in the commented out section of the the advanced example for the "$CSV->output_column()" method.
This should make quick work of extracting values from a CSV in any way you want. To extract a column would look like this:
$data_file = 'my_data_file.txt';
$file_delimiter = '|';
$csv = new csvCRUD($data_file,$file_delimiter);
//To output col B as an array of values:
$col_2_values_array = $csv->output_column('B','array');
//Or to output col B as a comma delim string of values:
$col_2_values_string = $csv->output_column('B','string');
If you do not want to use the class, you can dig in and look at the functions that do the work...I like using the class because there are also built in methods to dump results to a table, XML, JSON, etc... You can also "query" a CSV to extract only certain records, or use the built in forms to edit CSV records.