in reply to Re: Splitting a string on commas except when inside quotes
in thread Splitting a string on commas except when inside quotes
What is that comma and double quotes doing to $line?my $line = '11/21/2022,Payment,"Transfer to Smith, account 2",,USD,,123.60,'; print " $line\n"; my ( $fDate, $fType, $fDetails, $fRef, $fCurrency, $fAmount, $fPaidOut, $fFees ) = "$line," =~ /(".*?"|[^,]*),/g; # NOTE
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Splitting a string on commas except when inside quotes
by tybalt89 (Monsignor) on Jan 02, 2023 at 20:38 UTC |