Results 1 to 6 of 6

Thread: ctrlf is gone when i use the right function

  1. #1

    Thread Starter
    Hyperactive Member schuurke28's Avatar
    Join Date
    Feb 2001
    Posts
    402

    a cry for help, i need to put a ctrlf in a textfile after using the right function

    in the text file there is a ctrlf on position 600.
    I need the 550 positions of the right (with the ctrlf), i
    used the right function because i don't need the first 50 characters of the left.
    But, the right function gives a result without the ctrlf (control line feed) caracter.
    How can i obtain that this character is set on position 600?

    see attachement for text file

    code:
    Sub Main()


    Open "C:\Program Files\Protime\ProTime Premium\magi2.txt" For Input As #1 ' Open bestand voor invoer
    Open "C:\Program Files\Protime\ProTime Premium\magi3.txt" For Output As #2 'open bestand voor uitvoer

    iRight = 550

    Do While Not EOF(1) ' Controle op einde bestand

    Line Input #1, sString

    sRightString = Right(sString, iRight)
    Debug.Print sRightString

    Print #2, sRightString
    Debug.Print sFinalString

    Loop
    Close #1
    Close #2
    End Sub
    Attached Files Attached Files
    Last edited by schuurke28; Feb 7th, 2001 at 11:50 AM.

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    is the attachment..

    is the magi.txt the starting file or the finish file?

    post magi2.txt

    and create a magi3 how you want it to look...and post that too (not what the program creates but how you want it to look)

    and are you using VB6?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Hyperactive Member schuurke28's Avatar
    Join Date
    Feb 2001
    Posts
    402
    sorry, indeed, magi.txt is the start file
    code must be:

    Open "C:\Program Files\Protime\ProTime Premium\magi.txt" For Input As #1
    Open "C:\Program Files\Protime\ProTime Premium\magi2.txt" For Output As #2

    i use VB6

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    how do you want the result to look...
    can you take the magi.txt and make it look like how you want it to...That would help me
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    Hyperactive Member schuurke28's Avatar
    Join Date
    Feb 2001
    Posts
    402
    this is how it must look like.

    But the mid function did the job well, of course, i'm always interested in any solutions
    Attached Files Attached Files

  6. #6
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    hmmm

    well ...
    the format is not holding up when I save the attachments...but...

    Open "C:\magi.txt" For Input As #1
    Open "C:\magi2.txt" For Output As #2
    Do Until EOF(1)
    Line Input #1, Getit
    Getit = Right(Getit, 550)
    Print #2, Getit & vbCrLf
    Loop
    Close #1
    Close #2

    should work fine....
    Last edited by Static; Feb 7th, 2001 at 12:49 PM.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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