Results 1 to 4 of 4

Thread: [RESOLVED] Spliting help

  1. #1

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    Resolved [RESOLVED] Spliting help

    I need some help (again) splitting a huge textfile.

    there are lots of points in the file that start with <A href="/gp/product/ and then a number and then a /

    how would i get ALL the info between these two points throughout the entire document

    thanks for your time

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Spliting help

    This works for me

    VB Code:
    1. Dim s As String
    2. Dim pos As Long
    3.  
    4. Open "C:\YourFile.txt" For Input As #1
    5. s = Input(LOF(1), 1) 'grab entire file
    6. Close #1
    7.  
    8. pos = InStr(1, s, "<A href=""/gp/product") 'check if search string is found
    9.  
    10. Do Until pos = 0
    11. pos = pos + 21 '21 is the length of search string
    12.  
    13. Debug.Print Mid$(s, pos, InStr(pos + 1, s, "/") - pos) 'get numbers
    14.  
    15. pos = InStr(pos, s, "<A href=""/gp/product") 'check if search string is found again
    16. Loop

  3. #3

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    Re: Spliting help

    .... I have no idea how respond, within the hour you save the day, again ^.^

  4. #4
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Spliting help

    Good to see my work here is done!

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