On 13/06/11 11:37, Richard Parsons wrote:
Brett ParkeriDunno@sommitrealweird.co.uk wrote:
So, what I'd be looking at is:
Table : Brewery Columns: id name description Table : Beer Columns: id brewery_id name description
That looks much better to me. Now you need to write some sql that creates that database. Have a look at the sqlite documentation for that.
Writing the code would be a problem for me, so, I cheat! I use this - http://sourceforge.net/projects/sqlitebrowser/ under WindowsXP running in VirtualBox.
Thus having a one to many relationship between brewery and beer, storing the id of the brewery in the beer means that you can change the fields of the brewery (in the event of it being renamed, or the description changing, etc), and that applies immediately to all beers of the brewery.
This is normal database normalisation.
That's a mouthful. :)
Now back to your original question. Can you convert the spreadsheet to csv? That will make it easier to parse. Perhaps then give the first few lines of that csv, so we can help with parsing it.
Yes I can, but having seen the 'discussion' that erupted afterwards, I'd say TSV is preferred. Like others, I spent ages trying to fix data import for a certain large insurance company for mailshots.
Also, which scripting language do you want to do this in? Bash is probably easiest for me. Python will do it easily enough. Perl can do it, but I don't know perl (others on the list probably do). Someone suggested awk: that would probably be neater that bash/python, but I'm sure not as experienced in it. I'm sure there's lots more options (ruby etc).
I *might* be able to cope with Python. I have no experience of Perl but Python having similar structures to BBC Basic - my only programming experience - I'd be prepared to give that a go.