csv import question

Started by joyceg, January 18, 2016, 09:30:20 AM

Previous topic - Next topic

joyceg

I'm interested in switching from Cumulus (unsupported single user version) to IMatch. To be able to do this, I'll need to import a CSV file into IMatch. I can create a CSV in any format IMatch would like. However, I've been unable to import even a small test CSV into IMatch. I read the IMatch Help pages. As far as I can tell I'm following the instructions correctly....

This is the very simple contents of my CSV file:

"File Name","Location"
"E:\TestIMatch\2015_10_01\bug04_20151001_01.CR2","Bear Creek"
"E:\TestIMatch\2015_10_01\bug04_20151001_02.CR2","Bear Creek"
"E:\TestIMatch\2015_10_01\bug04_20151001_03.CR2","Bear Creek"

If I try to import with "First row contains column names" checked, I get an error (see attached screenshot). If I click Ok, I get a spinning wheel, no column names appear, nothing happens (and no data is uploaded).

I tried different delimiters -- same result.

I also tried not including the first row of column names (see second attached screenshot), and instead mapping the columns in the "Import CSV File" window. Oddly, when I uncheck "First row contains column names", the importer thinks I have 5 columns (there are only 2), and if I click "Import" it says it only imported one record. I don't see the "Location" field getting populated for any of these files though.

I double-checked the filenames, and they are good.

I tried both {lf} and {crlf} for the "Record delimiter," with the same results. (My CSV file was created in linux. I've been editing it in Notepad++.)

What am I doing wrong?

Thanks.

[attachment deleted by admin]

Mario

#1
I saved your sample records into a text file with the .csv extension.
I changed the file names to match some files in my database.
I opened the file in the CSV Import script and used these settings (, as the Field delimiter):




The import worked and the Location data was imported into the XMP Title tag,
I have attached the file I used for this test.

You have specified only {lf} as the record delimiter. On Windows, {crlf} is used usually.
Don't import the file name into the IMatch file name metadata tag. This tag is filled by IMatch automatically when importing files.
Leave the file name field empty, just use the radio button in front to tell IMatch which column in your file contains the file name.

[attachment deleted by admin]
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

joyceg

Thanks for the response Mario.

If I use {crlf} and have "First row contains column names" checked I get the same error:

An error has occurred in the script on this page:
Line: 275
Char: 4
Error: Invalid character
Code: 0
URL: file:///C:/ProgramData/photools.com/IMatch5/scripts/system/CSV%20Import/UI.html
Do you want to continue running scripts on this page?

I then have a choice of clicking "Yes" or "No". No matter which one I click, I get a spinning wheel and never see any column names. It seems to hang when trying to read the first line of my file.

Any ideas as to why IMatch is responding differently for me than for you?
Screen shots and zip of data file attached.
I'm running 5.6.5.


[attachment deleted by admin]

Mario

I figured it out.
It is an error in the HTML page that drives the UI.
The row delimiter is not set correctly. Fixed for the next release.

You can work around this by creating the CSV file with Windows carriage-return linefeeds (0x13,0x10) instead of UNIX-style linefeeds (0x10).
Alternatively replace the file

C:\ProgramData\photools.com\IMatch5\scripts\system\CSV Import\UI.html

on your system with the attached version. Then make sure that you switch the row delimiter once to {crlf} and then back to {cr}. You may get an additional error, just click on "Continue running scripts". Then re-open your file again.



[attachment deleted by admin]
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

joyceg

I replaced UI.html with your new file. It works perfectly now!!!

Thank you!!!!!! I really appreciate your very fast reply too.

Mario

Great.
Let us know how your Canto migration works out.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook