I am trying to write a program that reads through a word document, examines tables, copies their contents to the clipboard and saves them into lists of lists:
List<List<Strin g>> and also one List<List<List< String>>>
Think of it kind of like filing intructions into a list of how to build a dining set or something. The set has different parts, which each will have their own instructions.
Dining Set
- Table
- Step 1 - put on legs
- Step 2 - place top on legs
- Chairs
- Step 1 - unpack cushion
- Step 2 - assemble back
and so on.. Where each step is a String.
I can get each step string and add it to a list of each part, but when I start on a new part, it overwrites the previous part.
So my instructions for say the table, will be output as the steps for the chairs. It basically makes everything equal to whatever the last part was. This I am assuming is because of memory pointing. Because I go and change stuff that other things reference, it it will change whatever it referencing it.
So my question is, Is there any way of getting around this? I was hoping that c# had an eval function that I could use in place of this, but none exist.
I feel like this may be a simple fix, but I just can not think of it currently.
Sample Output. Note: Each Case shoudl have differnet numbers of steps
Scenario 1
Case 1: 7 steps
Case 2: 7 steps
Case 3: 7 steps
Case 4: 7 steps
Case 5: 7 steps
Case 6: 7 steps
Case 7: 7 steps
Case 8: 7 steps
Case 9: 7 steps
Case 10: 7 steps
Case 11: 7 steps
Case 12: 7 steps
Scenario 2
Case 1: 12 steps
Case 2: 12 steps
Case 3: 12 steps
Case 4: 12 steps
Case 5: 12 steps
Case 6: 12 steps
Case 7: 12 steps
Case 8: 12 steps
Case 9: 12 steps
Case 10: 12 steps
Scenario 3
Case 1: 1 steps
Case 2: 1 steps
Case 3: 1 steps
Case 4: 1 steps
Case 5: 1 steps
Case 6: 1 steps
Case 7: 1 steps
Case 8: 1 steps
Case 9: 1 steps
Case 10: 1 steps
Case 11: 1 steps
List<List<Strin g>> and also one List<List<List< String>>>
Think of it kind of like filing intructions into a list of how to build a dining set or something. The set has different parts, which each will have their own instructions.
Dining Set
- Table
- Step 1 - put on legs
- Step 2 - place top on legs
- Chairs
- Step 1 - unpack cushion
- Step 2 - assemble back
and so on.. Where each step is a String.
I can get each step string and add it to a list of each part, but when I start on a new part, it overwrites the previous part.
So my instructions for say the table, will be output as the steps for the chairs. It basically makes everything equal to whatever the last part was. This I am assuming is because of memory pointing. Because I go and change stuff that other things reference, it it will change whatever it referencing it.
So my question is, Is there any way of getting around this? I was hoping that c# had an eval function that I could use in place of this, but none exist.
I feel like this may be a simple fix, but I just can not think of it currently.
Sample Output. Note: Each Case shoudl have differnet numbers of steps
Scenario 1
Case 1: 7 steps
Case 2: 7 steps
Case 3: 7 steps
Case 4: 7 steps
Case 5: 7 steps
Case 6: 7 steps
Case 7: 7 steps
Case 8: 7 steps
Case 9: 7 steps
Case 10: 7 steps
Case 11: 7 steps
Case 12: 7 steps
Scenario 2
Case 1: 12 steps
Case 2: 12 steps
Case 3: 12 steps
Case 4: 12 steps
Case 5: 12 steps
Case 6: 12 steps
Case 7: 12 steps
Case 8: 12 steps
Case 9: 12 steps
Case 10: 12 steps
Scenario 3
Case 1: 1 steps
Case 2: 1 steps
Case 3: 1 steps
Case 4: 1 steps
Case 5: 1 steps
Case 6: 1 steps
Case 7: 1 steps
Case 8: 1 steps
Case 9: 1 steps
Case 10: 1 steps
Case 11: 1 steps
Comment