Active
Project:
Import / Export API
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jun 2007 at 15:34 UTC
Updated:
20 Jun 2007 at 15:34 UTC
In trying to call importexportapi_csv_get_parsed() directly, over-riding the delimiter and enclosure strings, it seems that an empty enclosure (common in tab-delimited files), breaks the regex.
FWIW, my (simple) solution was to make my tab-delimited file look like a comma-separated with quote enclosures.
$contents = str_replace("\r\n", "\n", $contents);
$contents = str_replace("\n\r", "\n", $contents);
$contents = str_replace("\r", "\n", $contents);
$contents = "\"". str_replace("\n", "\"\n\"", str_replace("\t", "\",\"", $contents)) . "\"";
$result = importexportapi_csv_get_parsed($contents);