in whatever field specified. Is there an easy way to do this in VB.NET?
Thanks for any suggestions.
August 11th, 2011, 01:34 PM
First you're going to want to use string.Split(Char(13)) or something to that effect to split your incoming string into an array of strings, one for each line. Then you're going to use string.Contains("10.1.2.3") which returns a bool that tells you whether the string contains that sub string.
I personally recommend C# over VB, they both use the same libraries and object structures for the most part, however, in general, C# coders will get a somewhat higher pay for similar jobs. It all comes down to the perceived 'purpose' of the language even though they both can do the same exact thing. One will assume a C# coder has more experience, as C# is more related to the C/C++, which is used by most experts on large scale projects, while VB is often the first language a programmer learns, and is more related to simpler, business applications. But this all of course is just my opinion. ;)
August 11th, 2011, 09:53 PM
Since you said you don't do much programming, i'll expand on mets post.
here is probably close to what you want.
after that, you would do the Split() on the string to break each of the comma separated values into their own.
Edit: oops, that was c#. here is the VB equivalent (May not be 100% right. havent done vb in ages)
Private Function ReservationFinder(comp As String) As String
Dim tr As TextReader = New StreamReader("c:\\file.csv")
Dim input As String = Nothing
Do While tr.Peek() <> -1
If String.Contains(comp) Then
August 11th, 2011, 10:20 PM
You guys are great! I will try this when I get home.
I wouldn't mind learning C#, but I really don't code that much. Most of what I do is scripting... I think the last time I opened visual studio before I started this project was close to a year ago.
Thanks a bunch for the suggestions and examples!
August 12th, 2011, 12:29 AM
VBScript with MS Office supports calling Excel functionality for searching and managing csv files.
I used that for a very similar script that managed MFDs across a network.
If I can find it, I'll post it so you can see the inner workings.
August 12th, 2011, 03:16 AM
Sounds interesting. Once again, all of the help is most appreciated.