0

I am using the Column Mapper to map columns from my source file to the respective system columns.

I get an error when the source column header has a "(" or ")" in there. The error occurs within the magmi UI.

Here is an example:

Mapped columns list: Name,Syle#,Width (inches)
New name for col Name: name
New name for col Style#: sku
New name for col Width (inches): width

Upon saving the profile, I get the following error:

**Warning:** syntax error, unexpected '('  in ColumnMappingItemProcessor.conf on line 7 in /public_html/magmi/inc/properties.php on line 49

I know a simple solution is to remove the "(" and ")" from the source but that is doesn't solve the issue. (I have 72 columns in source, and many of them contain "(")

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
shnozolla
  • 468
  • 10
  • 20

1 Answers1

0

Personally I have found that Magmi doesn't always meet my needs for data manipulation. What I would suggest doing is to write a .php file that creates a csv file in the proper, Magento Ready, import format. I suggest this for two reasons: 1) The data is prepared the Magento way 2) If you ever need to re-create the import file or change the data it is very easy to manipulate. (just don't delete your parser or data files)

$importFile = fopen('ProductImport.csv', 'w');
$dataSource = fopen('yourDataFile.csv', 'r');
$header = array(); //add the Header data here, export a sample from Magento to get all the correct fields
$write = array();
$write = array_fill(0, 98, ''); //98 = your field total could be +- 
fputcsv($importFile, $header);
while(($products = fgetcsv($dataSource, 0, ',')) !== FALSE) {
$write[0] = $prodcuts[0] //map your data like this associating the proper fields
//continue to map all your fields using whatever logic is needed to ensure the values are correct
//Then add each product to the csv file until you finish the loop
fputcsv($importFile, $write);
}
//Finally remember to close all your open files 
fclose($importFile);
fclose($dataSource);

Oh I also strongly support this method because if you need to manipulate the contents of your source file to match up what is needed for Magento you can do that with the various PHP functions & logic. You can custom build the product URL's if you wish, dynamically add them to categories, etc.

Vallier
  • 551
  • 1
  • 6
  • 10
  • Thanks @Vallier, I have flirted with this idea (of manipulating data in a php script) but I decided against it. Currently I am saving profiles in magmi for each data sheet, it seems to be working nicely, besides a few quirks. I may take your advice in the future though. – shnozolla Jan 03 '14 at 18:19