You are here:  » Support for OSCommerce export format


Support for OSCommerce export format

Submitted by support on Fri, 2013-01-11 11:29 in

Hi everyone,

A number of users have contacted me recently regarding support for an export file format created by OS Commerce. The file format is essentially CSV (pipe separated) but with "<endrecord>" instead of new-lines.

If using the Automation Tool, and on Linux hosting, provided that PHP is permitted to execute the `sed` program this can be used to replace "<endrecord>" with the new line character. If you require support for this file format, edit includes/automation.php and look for the following code at line 94:

    if ($status == "OK")

...and REPLACE with:

    if ($status == "OK")
    {
      if (strpos(file_get_contents($tmp,FALSE,NULL,0,1024),"<endrecord>")!==FALSE)
      {
        exec("/bin/sed -i 's/<endrecord>/\\n/g' ".$tmp);
      }
    }
    if ($status == "OK")

Cheers,
David
--
PriceTapestry.com