Importing glossaries

Importing glossaries

by James Phillips -
Number of replies: 6

Dear all,

I would like to import a single glossary file containing a large number of glossary entries (approximately 1500) into a blank glossary in Moodle. Can anyone tell me where I can find information that will explain to me exactly what format the file will have to be in for this data to enter smoothly (how should the fields and records be separated etc.). I would guess that each field in a text file (the entries contain text only) would be separated by a line break, with a space between records, but have no idea if this is correct, and also have no idea how many fields each glossary entry contains. I am fairly familiar with various database formats so I won't cry too much if the answer gets fairly technical!

Any help at all would be much appreciated.

Best regards,

James Phillips

 

Average of ratings: -
In reply to James Phillips

Slightly stupid question!

by James Phillips -
Sorry about the slightly stupid question. I simply downloaded the glossary file from my site and took a look at the XML format used. However, I still need to ask if there is a way of taking a long list of glossary entries in the form of a text file formatted for a database (comma delimited) and putting them into the format of this XML file for importing into the glossary. Please excuse my lack of knowledge in this area but I am fairly new to moodle.
In reply to James Phillips

Re: Slightly stupid question!

by James Phillips -
It would appear that XML spy and phpadmin is the way to go.
In reply to James Phillips

Re: Slightly stupid question!

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Nice conversation you're having here James.  smile

I would suggest looking at the import functions in phpmyadmin (which is really the MySQL LOAD DATA command) for importing CSV files straight into the glossary tables.
In reply to Martin Dougiamas

Re: Slightly stupid question!

by James Phillips -
Thanks Martin! Will do. Was well aware that I was in danger of coming across as a bit of a madman! wink
In reply to James Phillips

Re: Slightly stupid question!

by Ger Tielemans -
Or write in php a small script to convert the comma separated file into the wished XML format for the glossary. Or ask someone in the forum to write that script.Would be a very handy variation on an import filter.
In reply to James Phillips

Re: Slightly stupid question!

by Andy Diament -
At the risk of being accused of swearing, I've just exported a table from ACCESS XP to XML, added a couple of tags and the import worked 1st time; thanks to whoever made the import function work with the minumum number of tags......It did it to import some student's personal glossaries from the bad old days before moodle's glossary

Andy D