What is best approach to parsing CSV string to tab-delimited string?
In PHP, I'm able to utilize the implode and str_getcsv functions to convert a comma-delimited string to a tab-delimited string. The following is an example.
$strtotab = implode("\t", str_getcsv($str, ","));
I am wondering if there is a similar way to do this in Cache and ensure that it takes into account fields enclosed in quotes. I am away of the CSVTOCLASS() method in the %SQL.Util.Procedures class. As I understand it, this is used to convert an entire file rather than a single string. The goal is to be compliant with RFC 4180.
To provide an example, the following comma-delimited string should be viewed as having 5 pieces, and not 7.
ABC Company,"123 Main St, Ste 102","Anytown, DC",10001,234-567-8901
Any guidance would be appreciated.