Node export to CSV works however the resulting file is not a proper CSV and is unusable. I have been trying to use node export to export my files so that I can modify the data and remove unnecessary pieces so that I can use Node Import to import the data. I am migrating from one site to another and I need to be able to edit this csv file and then use it to import into another drupal site.

For some reason this module doesn't simply export the data into a CSV with commas as the field separator and a single quote as a text delimiter with a backslash as the escape character. For some reason it exports SOME fields with double quotes around the text while others don't have double quotes.

Here is an example of one node that is exported with CSV:

Most of the text fields have single quotes wrapped around them, but then you have others that have double quotes, you can see below. Look for

"'a:4:
"'Amigo Mansion
"'

Monday To Sunday

This causes problems because editors like excel and open office expect the format to be the same across the board. Can someone tell me why this module is outputting some fields with single quotes and others with single quotes wrapped by double quotes?

The way this is, it's unuseable, I can't go through 4000 records with 200+ columns and edit out single/double quotes.

462,'restaurants','en',517,1,1312792034,1318764928,2,0,0,0,0,0,464,1,'Amigo Restaurant','','','',1318764928,0,'anahi','',"'a:4:{s:13:""form_build_id"";s:37:""form-368abbb180a702986018930778cd7500"";s:7:""contact"";i:1;s:14:""picture_delete"";s:0:"""";s:14:""picture_upload"";s:0:"""";}'",'restaurants/462/amigo-restaurant-aberdeen',,NULL,517,'logo amigo.PNG','#FILES_DIRECTORY_PATH#/logos/restaurant/2011/logo amigo_0.PNG','image/png',8756,1,1318764927,'',810,150,42,0,'',0,'',0,'','',1,'export_images/logo amigo_0.PNG','

a cozy yet luxurios place where  to enjoy French cuisine

',5,,,NULL,517,'amigooo.jpg','#FILES_DIRECTORY_PATH#/featuredphotos/restaurant/2011/amigooo_0.jpg','image/jpeg',22487,1,1318764927,'','',811,220,293,0,'',0,'',0,'','',1,'export_images/amigooo_0.jpg',NULL,517,'table amigo.PNG','#FILES_DIRECTORY_PATH#/photos/restaurant/2011/table amigo.PNG','image/png',251529,1,1318764927,'','',809,397,262,0,'',0,'',0,'','',1,'export_images/table amigo.PNG',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,NULL,NULL,'http://www.amigo.com.hk',NULL,,889,NULL,NULL,16,NULL,NULL,NULL,'off',NULL,NULL,NULL,0,0,"'

Monday To Sunday
12:00 p.m. - 3:00 p.m.
6:00 p.m. - 12:00 a.m

'",5,NULL,950,,,,"'Amigo Mansion, 79A Wongneichong Rd., Happy Valley. Hong Kong.'",872,'跑馬地黃泥涌道79號A','2577 2202 or 2577 8993','amigo@amigo.com.hk',659,660,,,,,653,648,650,649,,,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,1,1,0,1,1312792034,NULL,0,,,,,,,889,872,'French',,'romantic',,,,653,,,648,650,649,,659,,,,660,482,FALSE,0,0,100,FALSE,'5a8b8dd8-f70c-11e0-b5d4-000e2ee8e857','e2e00676-f7ea-11e0-b5d4-000e2ee8e857','','','','','','',1,0,0,0,0,0,0,0,'','',10,16,2011,'','','','',0,0,'primary-links',0,'menu',0,0,0,0,8

Comments

drupalfan81’s picture

I noticed some of the CSV text got deleted by drupal's input formatter. Trying the code block.

462,'restaurants','en',517,1,1312792034,1318764928,2,0,0,0,0,0,464,1,'Amigo Restaurant','','','',1318764928,0,'anahi','',"'a:4:{s:13:""form_build_id"";s:37:""form-368abbb180a702986018930778cd7500"";s:7:""contact"";i:1;s:14:""picture_delete"";s:0:"""";s:14:""picture_upload"";s:0:"""";}'",'restaurants/462/amigo-restaurant-aberdeen',,NULL,517,'logo amigo.PNG','#FILES_DIRECTORY_PATH#/logos/restaurant/2011/logo amigo_0.PNG','image/png',8756,1,1318764927,'',810,150,42,0,'',0,'',0,'','',1,'export_images/logo amigo_0.PNG','<p>a cozy yet luxurios place where&nbsp; to enjoy French cuisine</p>',5,,,NULL,517,'amigooo.jpg','#FILES_DIRECTORY_PATH#/featuredphotos/restaurant/2011/amigooo_0.jpg','image/jpeg',22487,1,1318764927,'','',811,220,293,0,'',0,'',0,'','',1,'export_images/amigooo_0.jpg',NULL,517,'table amigo.PNG','#FILES_DIRECTORY_PATH#/photos/restaurant/2011/table amigo.PNG','image/png',251529,1,1318764927,'','',809,397,262,0,'',0,'',0,'','',1,'export_images/table amigo.PNG',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,NULL,NULL,'http://www.amigo.com.hk',NULL,,889,NULL,NULL,16,NULL,NULL,NULL,'off',NULL,NULL,NULL,0,0,"'<p>Monday To Sunday<br />
12:00 p.m. - 3:00 p.m.<br />
6:00 p.m. - 12:00 a.m</p>'",5,NULL,950,,,,"'Amigo Mansion, 79A Wongneichong Rd., Happy Valley. Hong Kong.'",872,'跑馬地黃泥涌道79號A','2577 2202 or 2577 8993','amigo@amigo.com.hk',659,660,,,,,653,648,650,649,,,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,1,1,0,1,1312792034,NULL,0,,,,,,,889,872,'French',,'romantic',,,,653,,,648,650,649,,659,,,,660,482,FALSE,0,0,100,FALSE,'5a8b8dd8-f70c-11e0-b5d4-000e2ee8e857','e2e00676-f7ea-11e0-b5d4-000e2ee8e857','','','','','','',1,0,0,0,0,0,0,0,'','',10,16,2011,'','','','',0,0,'primary-links',0,'menu',0,0,0,0,8
Anandyrh’s picture

Exactly what I am looking for

danielb’s picture

Status: Active » Closed (works as designed)

however the resulting file is not a proper CSV and is unusable

Incorrect. Your bug report is based on a false premise and in fact you described it exactly as it was designed to work. You can write your own export formats based on the existing ones if you need something specific.

drupalfan81’s picture

Component: Node export file » Node export

Has anyone found a way to deal with this? I really need this to work for me to be able to use this data. I have over 1000 records and when I open it in MS Excel, all my fields are left with single quotes wrapping the text INSIDE the cells which doesn't work as I want to copy and paste this data into another excel sheet to use with Node Import. I can't import the text with the single quotes included, and I don't know any easy way to remove this single quotes. I don't understand why Excel is displaying these files in this way. Can someone please help me with this?

dzubey’s picture

CVS export was removed in the latest release.

However, even though the module did not export CVS in everyone's "favorite" format, having any CVS export can be desirable, depending on one's use case.

If CVS export was included, with the caution that the data will need further processing (sed, awk, perl, etc), it would be helpful to at least me.