CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 30

Threaded View

  1. #19
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Finding strings in multiple files

    Jeez, you make things tough...

    Code:
    ReDim str(5)
    str(0) = "AAAAAA 1.1.1"
    str(1) = "AAAAAB 1.1.1"
    str(2) = "AAAAAC 1.1.1"
    str(3) = "AAAAAA 1.1.2"
    str(4) = "AAAAAB 1.1.2"
    str(5) = "AAAAAA 1.1.2"
      
    
      'str() = Split(strBuff, vbCrLf)
    '  MsgBox "There are " & UBound(str) + 1 & " lines in the file"
      
      Dim words() As String, y As Integer, max2 As String
      max2 = "0.0.0"
      For x = 0 To UBound(str)
        words() = Split(str(x), " ")
         For y = 0 To UBound(words)
           If y = 1 Then
             If words(y) > max2 Then
                max2 = words(y)
                st = st & words(0) & " " & max2 & vbCrLf
             End If
          End If
        Next y
      Next x
      MsgBox st
    Last edited by dglienna; July 26th, 2008 at 11:24 PM.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured