This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Tellico crashes when importing CSV

Tags: None
(comma "," separated)
Musikhörer
Registered Member
Posts
68
Karma
0

Tellico crashes when importing CSV

Wed Aug 18, 2010 10:52 am
Hello,

I want to migrate my CD collection from MySQL to Tellico. I exported the database to CSV and fiddled around with the file until it looks like a CSV file created by Tellico itself. But although it looks the same, I'm afraid it is not quite the same: Tellico recognizes the data and even finds the right fields because I copied the field names as first row to the new file, but when I click "import" it crashes.

I'm pretty sure that the crash is caused by the field "tracks", which has to be a table. I tried to include the tracks in the exported file and it looks like this example

Code: Select all
Album,Medium,Artist,Year,Genre,Tracks
Year Of The Cat,Compact Disc,Al Stewart,1976,Rock,Lord Grenville:: ::On The Border:: ::Midas Shadow:: ::Sand In Your Shoes:: ::If It Doesn't Come Naturally, Leave It:: ::Flying Sorcery:: ::Broadway Hotel:: ::One Stage Before:: ::Year Of The Cat:: ::


When I leave the tracks, the data gets imported without any problem. Can someone please tell me how to format the data correctly so I can import my CD collection to Tellico?

Thanks in advance
robbystephenson
KDE Developer
Posts
384
Karma
1
OS
Musikhörer wrote:Hello,

I want to migrate my CD collection from MySQL to Tellico. I exported the database to CSV and fiddled around with the file until it looks like a CSV file created by Tellico itself. But although it looks the same, I'm afraid it is not quite the same: Tellico recognizes the data and even finds the right fields because I copied the field names as first row to the new file, but when I click "import" it crashes.

You didn't mention what version of Tellico. I just tested with 2.1 and 2.3, and I couldn't yet reproduce the crash you had with that data.

Musikhörer wrote:Hello,
I'm pretty sure that the crash is caused by the field "tracks", which has to be a table. I tried to include the tracks in the exported file and it looks like this example

Code: Select all
Album,Medium,Artist,Year,Genre,Tracks
Year Of The Cat,Compact Disc,Al Stewart,1976,Rock,Lord Grenville:: ::On The Border:: ::Midas Shadow:: ::Sand In Your Shoes:: ::If It Doesn't Come Naturally, Leave It:: ::Flying Sorcery:: ::Broadway Hotel:: ::One Stage Before:: ::Year Of The Cat:: ::


I actually made some silly decisions (in retrospect) about formatting table data. It's possible to import table data (like tracks) from a CSV file, but the path to do so is going to sound needlessly complex and probably rather poorly thought-out. Sorry :-\

In order to import it correctly from CSV, you'll need to separate each column of the table data with :: and then each row with a unicode character, the "Line Separator", U+2028. And for you to use that character, you'll have to figure out how to enter unicode characters with your text editor. ??? In Kate, make sure you're using utf-8 by going to Tools->Encoding->Unicode, then you hit F7 and then type 'char 0x2028' (without the quotes). In emacs, typing 'Alt-x ucs-insert' and then entering '2028' (without the quotes) works. Save that file.

For Tellico to import the file correctly, you have to force it to import the CSV file as utf-8 data. If you're already using utf-8 for your system, just run Tellico as normal. If you're not, force it to use utf-8, by running it from the command-line like so:
Code: Select all
LC_ALL=en_US.utf8 tellico

Then you should be able to import the table data. That's the method for version 2.2 and 2.3. Things changed a bit in version 2.2, so if you're using an earlier version, let me know.

Sorry about it being so complicated. Your alternative is to skip importing the tracks, and then update them all once you have the albums in Tellico.
Musikhörer
Registered Member
Posts
68
Karma
0
robbystephenson wrote:You didn't mention what version of Tellico. I just tested with 2.1 and 2.3, and I couldn't yet reproduce the crash you had with that data.

At first I used the version that was found in the repository of the distribution I use: 2.1. Then I downloaded and compiled version 2.3, but the result was the same.

I actually made some silly decisions (in retrospect) about formatting table data.

Yes, we all learn as we get older. ;-) No need to agonise yourself.

In order to import it correctly from CSV, you'll need to separate each column of the table data with :: and then each row with a unicode character, the "Line Separator", U+2028. And for you to use that character, you'll have to figure out how to enter unicode characters with your text editor.

Ahhh! That's a very important clue! Not only do I need to figure out how to enter that character, but I need to use another editor that displays this character. You see: I created a new cd collection in tellico with just one cd, and exported that collection to CSV, in order to get to know how to format MySQL's output. But I did not see this special character when I looked at Tellico's exported data, so I had no clue that it was there. I only saw the four colons.

Sorry about it being so complicated. Your alternative is to skip importing the tracks, and then update them all once you have the albums in Tellico.

Actually I rebuild my cd data base from scratch. It took me nearly two days to rescan all my disks, but I guess it still was much quicker than trying to solve the crash problem. During this work I came up with the idea that it would be very nice if Tellico could be told to do a cd scan by a dbus signal. That way one could write a small script that tells Tellico to scan the cd as soon as the drive is closed and re-open the drive afterwards, waiting for the next cd. Also it would be very nice if Tellico had a menu button that would do this chain of commands: close the cd drive, scan the disk, open the drive.

May I suggest these features for future versions, please?
robbystephenson
KDE Developer
Posts
384
Karma
1
OS
Musikhörer wrote:During this work I came up with the idea that it would be very nice if Tellico could be told to do a cd scan by a dbus signal. That way one could write a small script that tells Tellico to scan the cd as soon as the drive is closed and re-open the drive afterwards, waiting for the next cd. Also it would be very nice if Tellico had a menu button that would do this chain of commands: close the cd drive, scan the disk, open the drive.

May I suggest these features for future versions, please?
Sure...that's a good proposal. Do you want to do a wishlist bug on bugs.kde.org ?? :)


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]