Author Topic: [FAQ] Can't get CSV import to work  (Read 10020 times)

0 Members and 1 Guest are viewing this topic.

Offline daddydave

  • Member
  • *
  • Posts: 28
    • View Profile
    • Me on Google+
[FAQ] Can't get CSV import to work
« on: August 10, 2010, 02:43:20 am »
I think Personal Video Database is the best of its kind that I've tried, the feature to have a list of actors is especially appreciated and I like the fact that it is very customizable.

My question is regarding CSV import, I don't seem to be able to import a movie through a CSV file no matter what I do. I've searched the threads and it looks like the usual workaround is to use XLS instead, but I wonder if I am misunderstanding something, particularly since it doesn't prompt for field structure on each import, which implies to me that there is some best configuration for the CSV plugin that I shouldn't have to keep changing. I may have some questions about XLS import as well, but I'll start with this because it may answer some of my XLS questions as well.

In preferences for the CSV import I have two fields pushed over to the right Title and Actors (if this were a real example, the intention would be to pull the remaining fields from IMDB -- love the Ctrl-Alt-I shortcut).  And I have a file that looks like this in Notepad:

"This is a test","No actor"


So to me, after importing, I should have a movie called This is a Test (which I don't).

I even tried exporting to CSV and I even failed to import that file.  I noticed the export created semicolon separated values in the file, so I also tried using semicolons in the delimiter for import. Also the exported file has three characters that appear at the beginning of the file ?»? in Notepad and Excel, which I am not sure what to make of. I am running Windows 7 x64.

So is there a best way to set up CSV plugin preferences to make it work or should I just stick with XLS files?
« Last Edit: September 22, 2010, 01:10:30 am by rick.ca »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Can't get CSV import to work
« Reply #1 on: August 10, 2010, 05:53:45 am »
Welcome, Dave.

It sounds like you haven't configured the plugin. At Preferences - Plugins select the CSV import plugin and click on Configure. You'll also have to do that for the Excel import plugin, if you choose to use it.

Offline daddydave

  • Member
  • *
  • Posts: 28
    • View Profile
    • Me on Google+
Re: Can't get CSV import to work
« Reply #2 on: August 10, 2010, 11:22:08 am »
That's kind of my question. How should it be configured? What am I doing wrong? Attached a screenshot of my configuration.

[attachment deleted by admin]

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Can't get CSV import to work
« Reply #3 on: August 10, 2010, 11:41:49 am »
The field mapping is fine, but you haven't entered the delimiter (comma) or text qualifier (quote).

Offline daddydave

  • Member
  • *
  • Posts: 28
    • View Profile
    • Me on Google+
Re: Can't get CSV import to work
« Reply #4 on: August 10, 2010, 11:54:31 am »
Ah, I had tried it with the delimiter but not the text qualifier. So just now I tried it again, with delimiter , and text qualifier " and it still doesn't import.

Would it be better to just take out the double quotes from the file and change the configuration accordingly? I thought quotes were pretty standard for CSV, but maybe I just think that because that's the way Excel exports to CSV.

Well I tried it that way, too (removed the quotes from both the file and the text qualifier in configuration) and it still didn't import.
« Last Edit: August 10, 2010, 12:02:06 pm by daddydave »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Can't get CSV import to work
« Reply #5 on: August 10, 2010, 12:07:04 pm »
Sorry, I don't know. I always use the Excel import.

buah

  • Guest
Re: Can't get CSV import to work
« Reply #6 on: August 10, 2010, 12:19:21 pm »
Instead quotes, I usually use @ or ~, when dealing with CSV export/import.

But I found it more convenient and more reliable to use xls file for such purposes.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Can't get CSV import to work
« Reply #7 on: August 10, 2010, 06:29:10 pm »
It seems like the "Ignore header" option is broken and as you have only one line in your file it is treated as header. Just move the data one line below. Note also that you need a delimiter at the end of each value (the last one as well) for the data to be fully imported.
Gentlemen, you can’t fight in here! This is the War Room!

Offline daddydave

  • Member
  • *
  • Posts: 28
    • View Profile
    • Me on Google+
Re: Can't get CSV import to work
« Reply #8 on: August 10, 2010, 07:50:54 pm »
It seems like the "Ignore header" option is broken and as you have only one line in your file it is treated as header. Just move the data one line below. Note also that you need a delimiter at the end of each value (the last one as well) for the data to be fully imported.

Thanks, nostra, this did the trick, but first I got a crash and I sent you the bug report. Then I remembered that in the process of trying to get this to work, I had tried saving this to a Unicode file (little endian I think). When I saved it back to ANSI, it imported fine. Thanks to everyone for your persistence!

 

anything