CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • CSV Files will not import at all
Pages: [1] 2

Author Topic: CSV Files will not import at all  (Read 5439 times)

xevioso

  • Guest
CSV Files will not import at all
October 18, 2010, 05:46:16 pm
Hi.  I am using CivicRM3.2.2 on a Joomla 1.5 installation.

No matter what kind of file I try to import, I cannot get past screen 1 when I try to import contacts. All .csv files I attempt to import are rejected.

The error is "Input file must be in CSV format".
1) I have made sure the file is in UTF-8 format.
2) I have changed from a comma to a ; and back again for the delimiter to test it in the legacy configuration. No luck.
3) I have tried importing files with "" around items and nd with no quotes. 
4) I exported from Open Office; downloaded and installed it today; no luck when exporting.
5)I match the fields and try test data that will match the users we already have as contacts.  I can't even import a single row.
6) We are running on a VPS so likely no memory issues.

I am totally stuck.

What would cause this?  How can I import my users?


Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: CSV Files will not import at all
October 19, 2010, 05:22:47 am
Quote from: xevioso on October 18, 2010, 05:46:16 pm
4) I exported from Open Office; downloaded and installed it today; no luck when exporting.

Any details here? OpenOffice couldn't export?

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

xevioso

  • Guest
Re: CSV Files will not import at all
October 19, 2010, 11:58:57 pm
Hi there.

Yes, open office did export...I could export as a UTF/8, choosing both a ; and a , as the delimiter.  In each case, I was unable to import any file exported by Open Office into our database.

As I said, I even tried making a basic file with a single entry, saved it in UTF8 format, and still was unable to import.  Always the same problem, it says I must import a csv file.  What are the possible problems that could cause this?  We are desperate to import our user database.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: CSV Files will not import at all
October 20, 2010, 12:11:46 am
Hello xevioso,

Could you try to create a file as test.csv w/ data as
"first name", "last name"
"abc", "xyz"

or you might want to take a look for attached sample test.csv file,
and do a test individual contact import on your local install and let us know if it works.

kiran
You Are Designed To Choose... Defined By Choice.

xevioso

  • Guest
Re: CSV Files will not import at all
October 20, 2010, 08:03:55 am
Hi there. 

I am unable to import this csv file.  I get the same error message, which is that:
Input file must be in CSV format

It's quite frustrating, because this is preventing me from getting paid for my projects. :-(

I am willing to work with your developers and pay someone to assist in fixing this, because it makes the whole component unusable; we can't import a single thing.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CSV Files will not import at all
October 20, 2010, 01:57:18 pm
Hi,

Are you on windows ? I saw today a problem importing on windows, tested on linux worked perfectly (same file).

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

xevioso

  • Guest
Re: CSV Files will not import at all
October 20, 2010, 09:46:27 pm
Yes, I am on Windows7.  I haven't tested this on a Mac or any other computer; I actually don't have another machine, so I'm hoping to get it working on Windows.

I am using Firefox, and have also tried this in IE8, hoping it will work there, but no luck.  This is a Joomla installation, not Drupal or stand-alone too.

--Jeremy

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: CSV Files will not import at all
October 21, 2010, 01:23:08 am
a suggestion - we have seen .csv files fail if they have been saved, the reopened, then uploaded - not sure if that is your case. but if you haven't tried yet, suggest you 'copy all' from current file, paste in to new file, save as new.csv - then try - good luck
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CSV Files will not import at all
October 21, 2010, 05:29:07 am
Hi,

Was asking about the server running civi, not about your computer sorry wasn't clear.

are you using excel ? Try with OpenOffice. For some reasons, Excel has a tendency to garbage the csv, almost like if they don't want you to use another format than their closed xls ;)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: CSV Files will not import at all
October 21, 2010, 08:18:58 am
Quote from: xevioso on October 20, 2010, 08:03:55 am
I am unable to import this csv file.  I get the same error message, which is that:
Input file must be in CSV format

Can you send me obfuscated CSV file that you're trying to import (address is michal at civicrm domain)? Seems like it contains characters, which are not considered either UTF or ascii. What language is it in?

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

xevioso

  • Guest
Re: CSV Files will not import at all
October 21, 2010, 10:07:43 am
Hi there.  I have attempted uploading files that have been saved, then reopened and saved, but also brand new files...files exported from open office as UTF8, and then never opened after that.  I have tried versions that only have one record, and I tried the sample version that was attached...and I still get the same error.

The server is running Linux; it is a VPS.

Initially I was using excel, but I downlaoded OpenOffice thinking that would solve it, as it has for others.  I tried multiple exporting formats, including UTF8. I used a sample of our data of 4 lines, then just one line with the table headers...and of course the file that was attached.  Nothing works.

Michael, I will send you an example file that failed.  But as I mentioned, the sample csv file failed, so something more serious is ocurring.

Are there any permissions I need to set anywhere?  Would that cause this?

--Jeremy

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: CSV Files will not import at all
October 21, 2010, 04:12:17 pm
Xevioso,

I was able to import all of the files you've sent me without any problem - that was on the system running 3.3.alpha1.

Most probably, there is probably something wrong with your installation, not CSV files. The error you're reporting is returned based on file (and selected strings from those files) checks for being ascii and utf (CRM_Utils_Rule::utf8File). Try to dig around the list of compiled in modules in your php and see if it's more or less standard. Also, check what's the legacy encoding field value in your CiviCRM install.

One more thing - if you're comfortable with digging around the code a bit, please modify CRM/Utils/Rule.php file by adding debug as below and let us know what's the message displayed by it when you try to import.

Code: [Select]
    static function utf8File( $elementValue )
    {
        $success = false;

        CRM_Core_Error::debug( 'elementValue', $elementValue );

        if ((isset($elementValue['error']) && $elementValue['error'] == 0) ||
            (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) {

            $success = CRM_Utils_File::isAscii($elementValue['tmp_name']);
            etc etc


Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

xevioso

  • Guest
Re: CSV Files will not import at all
October 22, 2010, 12:02:51 am
Hi.  I have no problem digging around the code, but I think the code you supplied may be faulty.  When I add it as is, as another static function, the admin screen breaks and I get a blank screen when I reload.  It looks like you didn't close your statements with brackets, I think, but when I add two to close everything it still break.  I remove the two etc etc and try closing it and it also breaks.

I am running 3.2.2, installed about two months ago. 
The legacy encoding field is a ",".  I tried it with a semi colon, but had no luck so I switched it back.

Thanks...

--Jeremy

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: CSV Files will not import at all
October 22, 2010, 03:01:51 am
Xevioso,

Sorry, I should have been more explicit here. Add only this line:

CRM_Core_Error::debug( 'elementValue', $elementValue );

in CRM/Utils/Rule.php in utf8File function. All the rest of the code that I pasted is there just for the context, so you can see where to paste it.

Legacy encoding field's default is Windows-1252 (that's on civicrm/admin/setting/localization&reset=1 screen) - if you have comma there, it's definitely wrong, it should be an encoding name. Please try the default.

Thx.
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

xevioso

  • Guest
Re: CSV Files will not import at all
October 22, 2010, 09:15:22 am
Thanks for clarifying.

So, I add this in, try to import, and in addition to the CSV error I get the following:

elementValue

Array
(
    [name] => test.csv
    [type] => text/comma-separated-values
    [tmp_name] => /var/www/vhosts/bluestarpr.com/tmp/phpPAyF8Y
    [error] => 0
    [size] => 39
)


At the top of the page.

Now, the website is www.bluestarpr.com, and I did have to make a change to the domain name for the base url from just bluestarpr.com to www.bluestarpr.com, but I did not change this for the base directory.

Our wesbite root is at www.bluestarpr.com/site, but we have the domain redirecting to that directory so hat it looks like it would be www.bluestarpr.com and not bluestarpr.com/site.  Not sure if this makes a difference.  But our base directory path is listed as /var/www/vhosts/bluestarpr.com/httpdocs/site/media/

So maybe it has something to do with this, but I am not sure what I would need to change any of this to.

Also, for the Legacy Encoding, yes, I meant it was set by default to Windows-1252 and I have changed it to UTF8 when I export; I was referring to the delimiter field, which was set at a comma but which I have tried changing back and forth to a semi-colon to test.

Thank you for your help; I'm sure the solution is close...this is preventing me from completing the site for the client.

--Jeremy

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • CSV Files will not import at all

This forum was archived on 2017-11-26.