reading text files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leonard Wright

    reading text files

    I'm developing a lottery program and want read a text file that has
    Draw date
    Draw number
    six lottery numbers
    all in comma delimited text file
    I want the user to select a draw number
    to show all the stats from that draw number

    From http://www.developmentnow.com/g/36_2...ges-csharp.htm

    Posted via DevelopmentNow. com Groups
    DevelopmentNow is an award-winning creative software development agency integrating mobile, web, hardware, mixed reality, and emerging technology.

  • Morten Wennevik

    #2
    Re: reading text files

    Hello nameless,

    Good for you, I suspect you were meaning to ask something, but unless you do, we can't help you.


    On Sat, 14 May 2005 19:07:40 +0200, Leonard <Wright<leonard .wright@ntlworl d.com>> wrote:
    [color=blue]
    > I'm developing a lottery program and want read a text file that has
    > Draw date
    > Draw number
    > six lottery numbers
    > all in comma delimited text file
    > I want the user to select a draw number
    > to show all the stats from that draw number
    >
    > From http://www.developmentnow.com/g/36_2...ges-csharp.htm
    >
    > Posted via DevelopmentNow. com Groups
    > http://www.developmentnow.com
    >[/color]



    --
    Happy coding!
    Morten Wennevik [C# MVP]

    Comment

    • Leonard Wright

      #3
      Re: reading text files



      What i need to no is the coding to display the contents of text
      delimited text file into text boxes

      *** Sent via Developersdex http://www.developersdex.com ***

      Comment

      • Morten Wennevik

        #4
        Re: reading text files

        Well, I'm not away of any easy way to read comma delimited text files.

        You can read textfiles by using

        FileStream fs = File.OpenRead(" filename.txt");
        string data = fs.ReadToEnd();
        fs.Close();

        You could split the data long \r\n or parse the filestream through a StreamReader and use ReadLine, then split the resulting line by the comma. However, things like "data","da,ta", "data" would not give the expected result.

        This page may provide some ideas.






        On Mon, 16 May 2005 18:56:12 +0200, Leonard Wright <leonard.wright @ntlworld.com> wrote:
        [color=blue]
        >
        >
        > What i need to no is the coding to display the contents of text
        > delimited text file into text boxes
        >
        > *** Sent via Developersdex http://www.developersdex.com ***
        >[/color]



        --
        Happy coding!
        Morten Wennevik [C# MVP]

        Comment

        Working...