Web Analytics Made Easy -
StatCounter How do I copy every other line? - CodingForum

Announcement

Collapse
No announcement yet.

How do I copy every other line?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I copy every other line?

    Hi,

    I just joined, and this is my first post.

    I have a text file with some contents. I already have a VBS that copies the contents of this file and pastes it inside another already existing file. How would I go about copying only select rows and/or every other row? Below is the code that I have already.

    Thanks.


    '//OPEN FILE and READSet objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile("C:\Test\FILENAME1.txt", 1)strFileText = objFileToRead.ReadAll()objFileToRead.Close

    ' ///PASTE Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFileToWrite = objFSO.OpenTextFile("C:\Test2\FILENAME2.txt", 2)objFileToWrite.Write strFileTextobjFileToWrite.Close
Working...
X