Read Text File

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I am trying to read a text file. Stop when it finds a match, skip a certain
amount of lines and then right that data to another file. I am in the
initial steps of this. It stops when it finds a match, but I need for it to
skip some lines and read the text file again.

Set fso = CreateObject("Scripting.FileSystemObject")
Set fs1 = fso.OpenTextFile("deml.txt", ForReading)

Do while not fs1.AtEndofStream
rs1 = fs1.ReadLine

If Mid(rs1,11,7) = "PRIMARY" Then
rs1.skipline()
rs1.skipline()
rs1.skipline()
rs1.skipline()
rs1.skipline()
MsgBox (rs1)
End If

loop


.



Relevant Pages

  • Re: Access Report to multiple PDF files
    ... Dim Recordset as rs1 ... Loop ... Prev by Date: ...
    (comp.databases.ms-access)
  • Re: Various Interest Rates
    ... The for loop below seems to be working for me, ... // calculate amount of deposit for each of ten years ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Re: Threading a server
    ... SMTP. ... needed the watchdog and with a reasonable amount of time. ... I am guessing that to deal with the timeout behaviour, ... The next message you posted commented on the loop. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: bootimage.c (3)
    ... what I doubt is that since the 'while' loop ... reads in click_size quantum if we don't have a rounded amount, the addr (as ... position and not to the end of the data segment, ...
    (comp.os.minix)
  • Re: Treeview count children???
    ... with the Children property? ... numbers then you are hitting the line multiple times in a loop somewhere. ... should never rely on VB to automatically convert from one variable type to ... I want to add nodes to a treeview and count the amount of children per ...
    (microsoft.public.vb.general.discussion)