I want the email addresses in a field from a line of CSV data, but the list contains commas.
Therefore I split the contents within the field as well, which means I can't control the contents of this field because I only know how to do this with the split
command.
Example data:
12/01/2017, billybob123, billybob@bobthebomb.com, roxy@roxmysox.com, joey@rosytosy.com, AB, tom@tomsticles.com, \\123\abc
# Open file for read
while ( my $fileLine = <READ> ) {
chomp $fileLine;
my @row = (split ',', $fileLine);
print $fileLine[3]\n\n";
}
I use $fileLine[3]
. The result I want is
roxy@roxmysox.com, joey@rosytosy.com
but I get
roxy@roxmysox.com
The number of comma-delimited email addresses inside this field is dynamic.