CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Posts
    102

    Question saving text to file

    Hi All,

    A newbee here - i am trying to save text I am reading from file A to file B.
    However, the file is saved with the quotation marks like that: "line text" <--- this is what i get when i open the file with notepad.
    I tried triming the sides of the string, but the quotation marks are still there - but fewer "real" character from the line (1 on each side of the line)...

    How can I write text to a file, and not have the quotation marks?

    this is my code:

    Open txtSource.Text For Input As #1 'the text box holds the path
    Open txtTarget.Text For Output As #2

    Do While Not EOF(1)
    Line Input #1, read_line
    Write #2, read_line
    Loop


    Thanks in advance

    Dani.

  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210
    Use the Print command instead of Write.
    Something like
    Code:
    Print #filenumber,outputlist
    Go to Help and look up the "Print # Statement" for an explanation and example

  3. #3
    Join Date
    Sep 1999
    Posts
    102

    Thumbs up

    Thanks - that did the trick!

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

Featured