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

    Reading "\t" and "\n" from a text file

    Hi,

    I am reading strings from a text file. I've entered characters such as \t and \n in the text file to act as tab and newline characters. However when I read the strings from a text file and display them in the application, "\t" and "\n" are displayed rather than the cursor being tabbed or starting on a newline.

    Why is this and how can I implement tab and newline characters in the text file?

    Thanks for any help,

    Kim Phillip


  2. #2
    Join Date
    Nov 1999
    Location
    CA
    Posts
    115

    Re: Reading "\t" and "\n" from a text file

    If you type a text file mannually and want to have tabs and new lines, just use the tab key or the Enter key on the keyboard. You don't need to type in "\t", "\n". Otherwise, they will be read as what they are displayed in the text file.

    When you generate a text file programmtically, you need to use "\t" or "\n" to create tab or new line in the output file.

    Hope this answers your question.



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