nican VIP
Total posts: 392
23 Oct 2015 08:12

Hello,

I am testing the import feature in cobalt

I attach the test file I am using

quotes-and-authors-edited-2-first3

I do select (;) as he values separator, but when I move on with the import the system seems not to recognize the different columns

cobalt_import_issue

Another doubt I have is that I have the user ID in this CSV file to be able to associate the contents to the site usres, will Cobalt do that automatically (because I don't see an option for that in the import screen)

Thank you

Last Modified: 26 Oct 2015


Sergey
Total posts: 13,748
23 Oct 2015 13:26

This is common issue. I also had this from time to time. I do not know why. I am usid php while(($row = fgetcsv($handle, 2048, $delimiter)) !== FALSE). SOmetimes it does not parce it well. I do not know why.


nican VIP
Total posts: 392
23 Oct 2015 14:11

:-(


pepperstreet VIP
Total posts: 3,837
23 Oct 2015 21:57

nican I do select (;) as he values separator, but when I move on with the import the system seems not to recognize the different columns

I remember an older topic, where a similar effect appeared. Although the file format and delimiter seemed to be alright.
Sometimes it is also related to the exporting application (encoding, escaping, line-endings etc.)
Try to re-open and export the file in different applications! Sometimes it works true wonders.


Related topic

How to import records from spreadsheet file?
(issues with ; separator and Excel export)


nican VIP
Total posts: 392
24 Oct 2015 09:18

pepperstreet Try to re-open and export the file in different applications!

Sorry Pepperstreet I don't get it, are you saying to try to export those in contents in csv using a different application?

I have to edit and manage this file in excel, so excel is what I use to create the final csv output. I may try to change ANSI to UTF-8 later in notepad though. I'll gve it a try.


nican VIP
Total posts: 392
24 Oct 2015 09:47

I made some tests:

this format (using ; as separator) is not being imported (the system doesn't recognize the separators)

title;text;created_by;created;author;category;hits
lorem ipsum;"lorem ipsum";1395;28/12/2012 22:58;Alan Watts;Spiritualità;100

this format (using , as separator) is being imported,

id,title,text,created_by,created,author,category,hits
1,lorem ipsum,"lorem ipsum",16,28/12/2012 22:58,Alan Watts,Spiritualità,100

but the date field causes the error DateTime::__construct() [datetime.--construct]: Failed to parse time string (28/12/2012 22:58) at position 0 (2): Unexpected character

you need to change the date format to 28-12-2012 22:58 in order for it to work

you also have to set an ID for the content, even if it seems to be an optional field, the system requires it if you don't eneter it


after this, the file is being imported, but because this type is set with composite title the system requests a title and refuses to finalize the import :-(

So in the end the only workaround for me should be to temporarely set this type with a title field instead that composite title, perform the import and then set it back to composte title

I still don't undertsand if cobalt will import the id of the user who published the content


nican VIP
Total posts: 392
24 Oct 2015 13:45

More tests...

this format

id,title,text,created_by,created,author,category,hits
1,Abu-Hasan el-Shadhili,"La conoscenza deriva da: a Io sono.",1395,18-04-2012 12:17,Abu-Hasan el-Shadhili,Spiritualita,252
2,Alan Watts,"Il problema nasce proprio perchéo..., d coscienti.",1395,28-12-2012 12:58,Alan Watts,Spiritualita,114
3,Alan Watts,"Lo Zen non confonde La Spiritualita Zen è solamente pelare le patate.",1395,28-02-2013 12:38,Alan Watts,Spiritualita,198

is being imported, but with the following errors:

the "category" is not being associated correctly (yes, I do select the correct category association before importing) the "text" column is not being imported at all (maybe because of the " symbol enclosing the text, I thought it was necessary for the system to not consider as separators the commas inside the "text" column)

well... I am really close to give up with the Cobalt import feature, it's just not working for me (and is is a very simple test file, I have really coomplex csv file that need to be imported)

I think in the end I will have to invest those $200 for a custom plugin for Foobla - ObGrabber!


klox7 VIP
Total posts: 914
25 Oct 2015 10:38

I also remeber having problems with importing csv. At the end I think I managed to get working file by saving it with Libre Office with utf-8 and semicolon.


nican VIP
Total posts: 392
26 Oct 2015 08:51

Thanks guys, if I ever find the will I'll try to test some more :-)

Powered by Cobalt