Click here to Skip to main content
15,894,405 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: bindingsource.filter not working Pin
Richard Deeming27-Jan-17 2:07
mveRichard Deeming27-Jan-17 2:07 
GeneralRe: bindingsource.filter not working Pin
Member 1108983127-Jan-17 4:23
Member 1108983127-Jan-17 4:23 
GeneralRe: bindingsource.filter not working Pin
Richard Deeming27-Jan-17 4:26
mveRichard Deeming27-Jan-17 4:26 
GeneralRe: bindingsource.filter not working Pin
Member 1108983127-Jan-17 7:20
Member 1108983127-Jan-17 7:20 
GeneralRe: bindingsource.filter not working Pin
Richard Deeming27-Jan-17 7:37
mveRichard Deeming27-Jan-17 7:37 
QuestionHow to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 5:29
Member 1186689324-Jan-17 5:29 
AnswerRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Richard Deeming24-Jan-17 6:02
mveRichard Deeming24-Jan-17 6:02 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 8:13
Member 1186689324-Jan-17 8:13 
Thanks for the response. I made the suggested changes and am still having issues. This is what I have now:

VB
Sub Main()
        '--------------------------------------------------------------------------------------------------------
        'Declare Variables
        Dim strSiteCode
        Dim strVistaFQDN
        Dim strPort
        Dim arrStr
        Dim Sites As String = My.Computer.FileSystem.ReadAllText("c:\dell\Sites2.txt")
        '--------------------------------------------------------------------------------------------------------
        'Start processing

        Using sr As New StreamReader("c:\dell\R03Sites3.csv")
            Dim line As String
            ' Read and display lines from the file until the end of
            ' the file is reached.

            Do
                line = sr.ReadLine()
                Console.WriteLine("line = " & line)
                Console.WriteLine("Start processing loop")
                If line IsNot Nothing Then
                    arrStr = Split(line, ",")
                    If arrStr.Length >= 3 Then
                        strSiteCode = arrStr(0)
                        strVistaFQDN = arrStr(1)
                        strPort = arrStr(2)
                        Console.WriteLine(Trim(Sites) & " , " & Trim(strSiteCode))
                        Console.WriteLine("s=" & strVistaFQDN & " p=" & strPort)
                        Console.WriteLine("Array populated...  Enter if then statement")
                        If Trim(Sites) = Trim(strSiteCode) Then
                            'Console.WriteLine(Trim(Sites) & " , " & Trim(strSiteCode))
                            'Console.WriteLine("s=" & strVistaFQDN & " p=" & strPort)
                            Console.WriteLine("Successfully processed!")
                            Exit Do
                        Else
                            Console.WriteLine("Error:  No Matching Information in the Sitecode and R03sites files!")
                        End If
                    End If
                End If
            Loop Until line Is Nothing
        End Using
    End Sub


Here is the output (I cut the R03 file down to 2 entries):

C:\Dell>bcmass
line = BEC,test.beckley.com,19233
Start processing loop
BEC,BEC
, BEC

s=test.beckley.com p=19233
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
line = BIR,test.birmingham.com,19230
Start processing loop
BEC,BEC
, BIR

s=test.birmingham.com p=19230
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
line =
Start processing loop


The bold entries should read BEC,BEC and BEC,BIR instead of BEC,BEC,BEC and BEC,BEC,BIR. I'm not sure how make the if then statement read only the first BEC for the Sites2.txt file and the Site code out of R03sites3.csv and then continue processing/reading the matching information.
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Richard MacCutchan24-Jan-17 8:38
mveRichard MacCutchan24-Jan-17 8:38 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 9:07
Member 1186689324-Jan-17 9:07 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Richard MacCutchan24-Jan-17 9:37
mveRichard MacCutchan24-Jan-17 9:37 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 10:03
Member 1186689324-Jan-17 10:03 
PraiseRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689325-Jan-17 5:42
Member 1186689325-Jan-17 5:42 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Richard MacCutchan25-Jan-17 5:57
mveRichard MacCutchan25-Jan-17 5:57 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Member 1186689324-Jan-17 9:11
Member 1186689324-Jan-17 9:11 
GeneralRe: How to compare 2 different text file lines and then process information if a match is in both file lines - Please help Pin
Eddy Vluggen25-Jan-17 6:21
professionalEddy Vluggen25-Jan-17 6:21 
QuestionHow to download all latest files from ftp server to pc automatically in vb.net Pin
Member 1295777522-Jan-17 15:38
Member 1295777522-Jan-17 15:38 
AnswerRe: How to download all latest files from ftp server to pc automatically in vb.net Pin
Michael_Davies22-Jan-17 20:43
Michael_Davies22-Jan-17 20:43 
GeneralRe: How to download all latest files from ftp server to pc automatically in vb.net Pin
Member 1295777522-Jan-17 21:09
Member 1295777522-Jan-17 21:09 
GeneralRe: How to download all latest files from ftp server to pc automatically in vb.net Pin
NotPolitcallyCorrect23-Jan-17 2:20
NotPolitcallyCorrect23-Jan-17 2:20 
QuestionHow to download all latest files from ftp server to pc automatically in vb.net Pin
Member 1295777522-Jan-17 15:07
Member 1295777522-Jan-17 15:07 
QuestionIsolating text within a text box Pin
Member 1296154621-Jan-17 13:27
Member 1296154621-Jan-17 13:27 
AnswerRe: Isolating text within a text box Pin
NotPolitcallyCorrect21-Jan-17 15:13
NotPolitcallyCorrect21-Jan-17 15:13 
Questionvb.net 2010 code check if values exist Pin
dcof19-Jan-17 12:00
dcof19-Jan-17 12:00 
AnswerRe: vb.net 2010 code check if values exist Pin
NotPolitcallyCorrect19-Jan-17 13:38
NotPolitcallyCorrect19-Jan-17 13:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.