[RESOLVED] dropping text-VBForums
Results 1 to 6 of 6

Thread: [RESOLVED] dropping text

  1. #1

    Thread Starter
    Addicted Member ondalor's Avatar
    Join Date
    Jan 2013
    Location
    Washington DC
    Posts
    195

    Resolved [RESOLVED] dropping text

    How do i make the code drop the first 10 characters from each line of the source txt?

    Code:
    Open "source.txt" For Input As #1
    Open "destination.txt" For Output As #2
    Do While Not EOF(1)
        Line Input #1, LineOfText
                Print #2,
        Print #2, LineOfText
    Loop
    
    Close #1
    Close #2
    Last edited by ondalor; Jan 25th, 2013 at 10:46 AM. Reason: code error

  2. #2
    Frenzied Member
    Join Date
    Dec 2008
    Posts
    1,045

    Re: dropping text

    Code:
    Dim sLineOfText As String
     Dim sLineOfTextShortened As String
        sLineOfText = "1234567890abcdefgh"
        sLineOfTextShortened = Mid(sLineOfText, 11)

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,138

    Re: dropping text

    In the case of the code in the OP
    Code:
    Print #2, Mid$(LineOfText,11)

  4. #4

    Thread Starter
    Addicted Member ondalor's Avatar
    Join Date
    Jan 2013
    Location
    Washington DC
    Posts
    195

    Re: dropping text

    ..... how do I get it to drop the first 10 characters of each line?
    please explain i don't know what that last post means Datamiser -_-

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,138

    Re: dropping text

    Perhaps it would be a good idea to look up the Mid() function rather than having me type out an explaination

  6. #6

    Thread Starter
    Addicted Member ondalor's Avatar
    Join Date
    Jan 2013
    Location
    Washington DC
    Posts
    195

    Re: dropping text

    simple and to the point the mid fuction has been a life saver
    Live for the nights you won't remember with the friends you will never forget.

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.