CommuniMail - csv import format problems

Message
Author
raylutz
Posts: 11
Joined: Oct 25, 2007 2:46 am

csv import format problems

#1 Postby raylutz » Oct 25, 2007 6:12 am

I can't seem to get the CSV import to work, and your documentation is very limited in that regard!

I have created a text file that has this contents:

NAME,EMAIL
T & Cricket,[email protected]
Jane Cruz,[email protected]
Cynthia & Jeanette,[email protected]
Susan & Nick,[email protected]

But it will not import. What is wrong?

admin
Site Admin
Posts: 1839
Joined: Mar 22, 2006 12:32 pm

Re: csv import format problems

#2 Postby admin » Oct 25, 2007 6:59 am

raylutz wrote:I can't seem to get the CSV import to work, and your documentation is very limited in that regard!

I have created a text file that has this contents:

NAME,EMAIL
T & Cricket,[email protected]
Jane Cruz,[email protected]
Cynthia & Jeanette,[email protected]
Susan & Nick,[email protected]

But it will not import. What is wrong?

There are 2 reasons why your file cant be imported:

1. You should use full header set.
2. You should have all fields in there, even if they're blank

In other words, you shouldn't modify header and remove commas (fields separator) for fields which are blank.

HINT: In order to get sample import CSV file - you can use Export: just export existing contacts from system and take a look at format.


I hope that will help.
Thanks

raylutz
Posts: 11
Joined: Oct 25, 2007 2:46 am

Work-around + Correction suggestion...

#3 Postby raylutz » Oct 25, 2007 5:47 pm

I did an export and I notice now that you have an extra comma at the end of every line

STATUS,EMAIL,EMAIL2,NAME,PREFIX,COMPANY,TITLE,ADDRESS,ADDRESS2,CITY,STATE,ZIP,COUNTRY,FAX,ADD_INFO1,ADD_INFO2,CREATED,

That's really not standard CSV format, which does not require the extra comma at the end.

I was able to get my short CSV file to work as long as I put the extra comma at the end.

In reviewing your code, I believe you need the comma because you do not remove the line termination characters, and then the field has those line termination characters during further processing, comparison, etc. You should probably check on that. Don't sell yourself short. The code is designed to allow the fields in any order and does NOT require that you have all the fields.

Thanks!