Posted by coupet on March 13, 2008 at 1:35am
| Project: | Taxonomy CSV import/export |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Unable to import a CSV file with more than 3 terms. Displays error message when attempting to import a file with 4 terms. I think that functionality worked in 5.x version. Works with 3 terms OK.
Darly
Comments
#1
I have been able to import a hierarchical tree of US states and counties from a single CSV file. Especially the batch API (with the progressbar) makes it possible to import large files without script timeouts.
So I will need to know what error message you're getting and preferable what CSV file you're trying to import.
#2
The scenario is as follows:
Vocabulary: Car
Term1: Term2: Term3: Term4:
Year Make Model Type
2000 BMW 318 Sedan
2000 BMW 318 Coupe
2001 Ford Taurus Sedan
-Term1 (Year)
-Term2 (Make)
-Term3 (Model)
-Term4 (Type)
Darly
#3
I need the exact file, and the error message you're getting. Otherwise I can't help you.
#4
Hello naquah,
I think the problem was a square symbol inside the term name. I removed it and everything works now.
Thanks, Darly
Note: see attached file with term name.
#5
coupet, I would like to investigate the problem so that it won't happen again to somebody else. Can you give me the exact CSV file you used (so not the Excel file) and the exact error message you got?
#6
#7
naquah, attached is the csv file. I renamed the file extension to txt to allow for upload. Unable to upload file with csv extension. The original file was created in microsoft excel and save as a csv file.
Seems Character Sets and Encodings issue.
#8
I think if you add a line
setlocale(LC_ALL, 'en_US.UTF-8');
before the line
while ($line = fgetcsv($handle, 4096, $delimiter)) {
}
it will work. At least that's what worked for my file with multibyte strings. I guess you can add an option to the csv import form for setting this value.
#9
Thanks nnn,
This has worked for me as well.
Be sure your file is encoded in UTF-8
Using gVim:
:setlocal fenc=utf-8
#10
Alright, I'll try to make it work with any encoding.
#11
The batch API crashed as a result from the Windows-encoded lines. Fixed by base64-encoding the lines before passing them to the batch operations array.
Fixed in the latest development version.
Thanks!
#12
Automatically closed -- issue fixed for two weeks with no activity.