VBNovice
June 16th, 2001, 12:22 PM
I am running a program that shells out to DOS, runs Netstat -an then dumps it to a text file. I want to take this data and put it into a ListView with 5 categories. Most of that I have down. It is parsing the text file that I am having trouble with because the spacing and format is inconsistent:
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP xx.xxx.xxx.xxx:137 0.0.0.0:0 LISTENING
TCP xx.xxx.xxx.119:138 0.0.0.0:0 LISTENING
TCP xx.xxx.xxx.xxx:139 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1025 0.0.0.0:0 LISTENING
TCP 127.0.0.1:2412 0.0.0.0:0 LISTENING
TCP 127.0.0.1:110 0.0.0.0:0 LISTENING
TCP xxx.xxx.xxx
Mainly the problems comes from the amount of characters in any IP address. They are not all the same so I have had a heck of a time using Split function to work poperly. Any ideas or suggestions on another angle of attack for this would be greatly appreciated!
-Dave
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP xx.xxx.xxx.xxx:137 0.0.0.0:0 LISTENING
TCP xx.xxx.xxx.119:138 0.0.0.0:0 LISTENING
TCP xx.xxx.xxx.xxx:139 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1025 0.0.0.0:0 LISTENING
TCP 127.0.0.1:2412 0.0.0.0:0 LISTENING
TCP 127.0.0.1:110 0.0.0.0:0 LISTENING
TCP xxx.xxx.xxx
Mainly the problems comes from the amount of characters in any IP address. They are not all the same so I have had a heck of a time using Split function to work poperly. Any ideas or suggestions on another angle of attack for this would be greatly appreciated!
-Dave