coderguy1985
New member
- Joined
- Apr 3, 2015
- Messages
- 2
- Programming Experience
- 3-5
I'm trying to build a tree view off this old menu system and need to figure out the best way of doing this.
Basically I will read in the MAIN.TXT file below and those will be my high level nodes, but sub menus exist in MAIN.TXT like Submenu.txt and SecondSubmenu.txt, those will be separate text files.
Now my best guess here is that I should load in MAIN.txt first, then iterate through that list, and then iterate through the sub menus. The problem I am having is how would I structure my iteration to perform this?
Sample text files:
MAIN.TXT
A|runme.bat|Main Execution
A|runthis.bat|Secondary Execution
A|Submenu.txt|SubMenu
A|runagain.bat|Tietary Execution
A|SecondSubmenu.txt|SecondSubMenu
SUBMENU.TXT
A|Test.exe|Test Executable
SECONDSUBMENU.TXT
A|Secondmenu.bat|Second Menu batch
A|Thirdmenu.txt|ThirdSubMenu
THIRDMENU.TXT
A|Thirdmenu.bat|Third Menu batch
What I want my output to be:
Basically I will read in the MAIN.TXT file below and those will be my high level nodes, but sub menus exist in MAIN.TXT like Submenu.txt and SecondSubmenu.txt, those will be separate text files.
Now my best guess here is that I should load in MAIN.txt first, then iterate through that list, and then iterate through the sub menus. The problem I am having is how would I structure my iteration to perform this?
Sample text files:
MAIN.TXT
A|runme.bat|Main Execution
A|runthis.bat|Secondary Execution
A|Submenu.txt|SubMenu
A|runagain.bat|Tietary Execution
A|SecondSubmenu.txt|SecondSubMenu
SUBMENU.TXT
A|Test.exe|Test Executable
SECONDSUBMENU.TXT
A|Secondmenu.bat|Second Menu batch
A|Thirdmenu.txt|ThirdSubMenu
THIRDMENU.TXT
A|Thirdmenu.bat|Third Menu batch
What I want my output to be:
C#:
runme.bat - main execution
runthis.bat - secondardy execution
Submenu.cfg - SubMenu
Test.exe - Test Executable
runagain.bat - tietary execution
secondsubmenu
Secondmenu.bat - Second Menu batch
Thirdmenu.txt - thirdSubMenu
thirdmenu.bat - Third Menu batch
Last edited: