
normalising table with a fields containing CSV data
I recently post a similar request in m.p.a.queries but realised I'm better
off asking here.
I've got a table imported from an old flatfile database.
Several of the fields contains several items of data separated by commas.
How can I get this data decomposed into it's second normal form?
Take a look at http://www.*-*-*.com/
created using MS Access together with a little piece of software called
dbtoWeb that helps convert it to something that looks half decent. I'll
eventually port it to an SQL server but that's after I've got the relational
model sorted out properly.
As you can see, There are a several DJs playing in several rooms. At the
moment, I've got a fixed number of fields (5) for the Rooms (I've used
dbtoweb to not print any line that's empty) and the DJs are entered as a
string, separated by commas.
What I want to do is normalise it so that (a) the number of rooms is
variable and (b) each DJ entry is on a separate record.
So,
If I've got things right, I've got two different problems, both relating to
normalization. (1) How to get all that csv data into separate records. and
(2) Normalize the Number rooms.
I think I (2) is more of a problem best suited to queries (still need some
help there) but how about (1)? That's a coding problem if ever I've seen it.
Thanks to some help from people (Hello Jethro) on m.p.a.queries, I can get
the data into separate fields but not records. Maybe I should just do that
and then normalize but I can't help thinking there's a more elegant
solution.
Dale Walker