( the below is just my idea of how to do it - if you have a better way please let me know because I think this is crap )

I am developing an on-line shop, but need some way to lay out the categories of products.
I have a data file, and a section of the file is in this format :

SAP_Code Main Category|Secondary Category|Third Category Product Name Some other crap blah1 blah2 blah3

So, overall its a tab delimeted file, but the second field, is a "|" pipe delimeted field that specifies the category of the product.
Here is a sample. I've included chunks and chunks of data from the file in the next post.
Its the "Section Text" field that I'm interested in.
It is in the form, as above : Main Category|Secondary Category|Third Category

What I was thinking, as a way to store the data in a DB, and be able to show the categories is :
Create a collection
Run through list line by line
For each line, extract the "Section Text" field
Give each part of the section text field an index - i.e. a number

So for example, if the below file is intact, and there weren't missing parts :

Backup Solutions|Backup Software|Computer Associates
0|1|2

Backup Solutions|Backup Software|Veritas
0|1|3

Backup Solutions|Streamers|Apple
0|4|5

Backup Solutions|Streamers|Hewlett Packard
0|4|6

Boards (video, sound, .)|Card Accessories|Adaptec
7|8|9

Boards (video, sound, .)|Graphics Cards (incl. CAD)|Apple
7|10|11

Boards (video, sound, .)|Graphics Cards (incl. CAD)|Compaq
7|10|12

Boards (video, sound, .)|Graphics Cards (incl. CAD)|Creative Labs
7|10|13

Boards (video, sound, .)|Graphics Cards (incl. CAD)|Gainward
7|10|14

Boards (video, sound, .)|Graphics Cards (incl. CAD)|Hewlett Packard
7|10|15

Boards (video, sound, .)|Host Adapters|Adaptec
7|16|17

Boards (video, sound, .)|Host Adapters|Belkin
7|16|18

Now, for the sake of the shortness of this post, I'll call the fields a|b|c
'a' is the main header, which appears on the front of the website.
Click on 'a', and you'll see every 'b' that's a sub category of a
Click on 'b', and you'll see every 'c' that's a sub category of b
Click on 'c', and you'll see every product that's of type a, b, c

I will store each 'a', its index, and the textual description of it
I will also store with that, each 'b' index that's a part of it.
e.g. :
0,Backup Solutions,1|4
7,Boards (video, sound, .),8|15

I will store each 'b', its index, and the textual description of it
I will also store with that, each 'c' index that's a part of it
e.g. :
1,Backup Software,2|3
4,Streamers,5|6
8,Card Accessories,9
10,Graphics Cards (incl. CAD),11|12|13|14|15
16,Host Adapters,17|18

I will store each 'c', its index, and the textual description of it
I will also store with that, each SAP Code/Product Reference index
e.g. :
2,Computer Associates,791755|791772|872095
3,Veritas,804202|749605|755887
5,Apple,855077|812664|812665
6,Hewlett Packard,758769|759547|743217

So. When the user comes to the main page, the database can pull the indices and descriptions from the main headers table :
Backup Solutions
Board (Video, sound, .)
etc.

When a user clicks on one, I can pass the index of that header back into the DB to pull the second level headers :
Backup Solutions
Backup Software
Streamers

When a user clicks on a sub header, I can again pass the index back into the DB, and pull the further sub header :
Backup Solutions
Backup Software
Computer Associates
Veritas

When a user clicks on a sub header, I can pass that back into the DB, and pull all products listed there :
Backup Solutions
Backup Software
Computer Associates
BrightStore Arcserve Backup Version 9 Tape Raid Option ...
BrightStore Arcserve Backup Version 9 Tape Library Option ...
BrightStore Arcserve Backup Version 9 Tape Universal Client Agent ...



Soooooooo. Any thoughts ?