Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. StreamReader and special tag problem

StreamReader and special tag problem

Scheduled Pinned Locked Moved C#
helptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cecildt
    wrote on last edited by
    #1

    Hi, I try to import a simple text file that have many rows with a special row format Example: |item|123|any items|4.50| When I read the lines in from the text file it removes the '|' tag. Why is that?? Example Code: StreamReader importFile = File.OpenText(txtPath.Text); txtLines.Text = txtLines.Text + importFile.ReadLine(); I know I'm missing something simple. Thanks for any help.

    C 1 Reply Last reply
    0
    • C cecildt

      Hi, I try to import a simple text file that have many rows with a special row format Example: |item|123|any items|4.50| When I read the lines in from the text file it removes the '|' tag. Why is that?? Example Code: StreamReader importFile = File.OpenText(txtPath.Text); txtLines.Text = txtLines.Text + importFile.ReadLine(); I know I'm missing something simple. Thanks for any help.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Perhaps | is a delimiter for the stream reader ? Is it reading the whole line every time, or up to the | ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      C 1 Reply Last reply
      0
      • C Christian Graus

        Perhaps | is a delimiter for the stream reader ? Is it reading the whole line every time, or up to the | ?

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        C Offline
        C Offline
        cecildt
        wrote on last edited by
        #3

        I'm reading a whole line into a temp string and use the '|' tag to divide the string into column values. When I read the whole string from the file the '|' tag is missing. So, I cannot divide the string up. thanx

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups