\r\n\r\n
Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET File I/O and Registry > How to Extract a word from . . .


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
I have run into a snag trying to extract a word from the output of a dos command.
\n
\nOutput:
\nNode IpAddress: [LanAddress] Scope Id: []
\n
\n NetBIOS Local Name Table
\n
\n Name Type Status
\n -' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-' + '-
\n PCN <00> UNIQUE Registered
\n Workgroup <00> GROUP Registered
\n PCN <20> UNIQUE Registered
\n Workgroup <1E> GROUP Registered
\n Workgroup <1D> UNIQUE Registered
\n ..__MSBROWSE__.<01> GROUP Registered

\n
\nSorry for the formatting, it didn\'t come out right. Anyway The thing I want to capture is italicized.
\n
\nThere are several ways to capture the text, currently I have it capturing the command output and placing it into a text box, from there I can save if I wish, I can also edit what is there. It will be a config file to be run in another part of the project. The problem is the PC Names change, as do the workgroups, what is constant is the <00> UNIQUE Registered portion. I can copy forward, but have had problems moving backwards since the # of spaces between the preceding < and the last letter of the pc name depends on the name of the PC.
\n
\nAny suggestions?
\r\n \r\n\r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; // next/previous post info pn[1316662] = "1316662,1316662"; pn[0] = ",1316662"; // cached usernames pu[0] = guestphrase; pu[181348] = "ZDC"; // -->
Prev Previous Post   Next Post Next
  #1  
Old 01-16-2009, 05:09 PM
ZDC ZDC is offline
Newcomer
 
Join Date: Jan 2009
Posts: 1
Default How to Extract a word from . . .


I have run into a snag trying to extract a word from the output of a dos command.

Output:
Node IpAddress: [LanAddress] Scope Id: []

NetBIOS Local Name Table

Name Type Status
---------------------------------------------
PCN <00> UNIQUE Registered
Workgroup <00> GROUP Registered
PCN <20> UNIQUE Registered
Workgroup <1E> GROUP Registered
Workgroup <1D> UNIQUE Registered
..__MSBROWSE__.<01> GROUP Registered


Sorry for the formatting, it didn't come out right. Anyway The thing I want to capture is italicized.

There are several ways to capture the text, currently I have it capturing the command output and placing it into a text box, from there I can save if I wish, I can also edit what is there. It will be a config file to be run in another part of the project. The problem is the PC Names change, as do the workgroups, what is constant is the <00> UNIQUE Registered portion. I can copy forward, but have had problems moving backwards since the # of spaces between the preceding < and the last letter of the pc name depends on the name of the PC.

Any suggestions?
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->