That worked perfectly. Thanks for the help.
The problem is that the CSV importer tries to write these into Couch variables with a space in the name, and trying to use variables with an embedded space doesn't go well!
To deal with this, I've added a line to the CSV importer as below (the line is commented; the others are for context). This simply replaces the spaces with underscores; if your data source uses underscores *and* spaces this may get confusing, but I guess that's fairly uncommon!
- Code: Select all
foreach( $rec as $k=>$v ){
$k = str_replace(" ","_",$k); //replace spaces with underscores in column headers
$CTX->set( $prefix.$k, $v );
}
This is at lines 356-358 of the file in the download linked on the first post of this topic, but looking at the Github repo it's at lines 363-366 in the latest version. I probably need to upgrade!
@KK - feel free to incorporate / criticise!