O
oliver
I'd like to code something recursively - it's not going to be in C
(VBA actually) but I hope this is the best place to ask.
I have a Bill of Materials structured like this:
row description
1 main assembly
2 .subassembly (of 1)
3 ..subassembly (of 2)
4 .subassembly (of 1)
5 ..subassembly (of 4)
6 ...subassembly (of 5)
7 .subassembly (of 1)
and I need to turn this into a table that looks like this
row parent
1 -
2 1
3 2
4 1
5 4
6 5
7 1
The (of 1, of 2) in the descritpions don't actually exist in the data,
the dots preceeding the description tell you that.
Ok so please help - I've been chipping away at this for hours and it's
so long since I did my degree I've gone a bit dopey and can't see the
wood from the trees. I "KNOW" the most elegant way to handle this is
recursively I just can't figure out how today.
Thanks very much - really appreciate your input
Olly
(VBA actually) but I hope this is the best place to ask.
I have a Bill of Materials structured like this:
row description
1 main assembly
2 .subassembly (of 1)
3 ..subassembly (of 2)
4 .subassembly (of 1)
5 ..subassembly (of 4)
6 ...subassembly (of 5)
7 .subassembly (of 1)
and I need to turn this into a table that looks like this
row parent
1 -
2 1
3 2
4 1
5 4
6 5
7 1
The (of 1, of 2) in the descritpions don't actually exist in the data,
the dots preceeding the description tell you that.
Ok so please help - I've been chipping away at this for hours and it's
so long since I did my degree I've gone a bit dopey and can't see the
wood from the trees. I "KNOW" the most elegant way to handle this is
recursively I just can't figure out how today.
Thanks very much - really appreciate your input
Olly