reading a database file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • leorulez@gmail.com

    #1

    reading a database file

    I need to read a file which can also be considered as a database (excel
    or access or just plain text file). Below is a sample representation of
    the file

    (col 1) (col 2) (col 3)
    name1 15 1890
    name2 20 3000

    If col 2 and col 3 are given I need to check if it corresponds to col 1
    or vice-versa. I am not sure if I can just use a simple text file or
    use a database and access it using C. I have not come across any code
    that can access a database. Any help on this would really be great.

  • Ian Collins

    #2
    Re: reading a database file

    leorulez@gmail. com wrote:[color=blue]
    > I need to read a file which can also be considered as a database (excel
    > or access or just plain text file). Below is a sample representation of
    > the file
    >
    > (col 1) (col 2) (col 3)
    > name1 15 1890
    > name2 20 3000
    >
    > If col 2 and col 3 are given I need to check if it corresponds to col 1
    > or vice-versa. I am not sure if I can just use a simple text file or
    > use a database and access it using C. I have not come across any code
    > that can access a database. Any help on this would really be great.
    >[/color]
    Not realy a C language question. Does the file exist, or do you have to
    define it?

    Every database I've used has a C API layer.

    --
    Ian Collins.

    Comment

    • leorulez@gmail.com

      #3
      Re: reading a database file

      The file does not exist. I need to create it. Like I said before it can
      be just a text file or excel or MS Access. All I need to do is check if
      col 2 and col 3 match with col 1.

      Comment

      • Joe Wright

        #4
        Re: reading a database file

        leorulez@gmail. com wrote:[color=blue]
        > The file does not exist. I need to create it. Like I said before it can
        > be just a text file or excel or MS Access. All I need to do is check if
        > col 2 and col 3 match with col 1.
        >[/color]
        One of us is confused. If you create the file of three columns per row
        then you already know that columns 2 and 3 match with column 1.

        See if you can turn this into a C language question.

        --
        Joe Wright
        "Everything should be made as simple as possible, but not simpler."
        --- Albert Einstein ---

        Comment

        • Ian Collins

          #5
          Re: reading a database file

          leorulez@gmail. com wrote:[color=blue]
          > The file does not exist. I need to create it. Like I said before it can
          > be just a text file or excel or MS Access. All I need to do is check if
          > col 2 and col 3 match with col 1.
          >[/color]
          So you are looking for advice on how to do this? There would be a
          simple C solution with only 3 columns, so give it a shot with a simple
          text file and post back here if you need help once you have some code.

          Oh by the way, please quote what you are replying to.

          --
          Ian Collins.

          Comment

          • CBFalconer

            #6
            Re: reading a database file

            leorulez@gmail. com wrote:[color=blue]
            >
            > The file does not exist. I need to create it. Like I said before it can
            > be just a text file or excel or MS Access. All I need to do is check if
            > col 2 and col 3 match with col 1.[/color]

            What file? There is no context, so who knows what you said
            before. You must always include adequate context in a usenet
            article. You can do this even with the foully broken Google usenet
            interface by following the instructions in my sig below. Also read
            the referenced URLs therein.

            Google is NOT Usenet. There is no guarantee any reader can see any
            previous messages, or in fact has ever received them. Thus any
            article must stand by itself.

            --
            "The power of the Executive to cast a man into prison without
            formulating any charge known to the law, and particularly to
            deny him the judgement of his peers, is in the highest degree
            odious and is the foundation of all totalitarian government
            whether Nazi or Communist." -- W. Churchill, Nov 21, 1943


            Comment

            • mensanator@aol.com

              #7
              Re: reading a database file


              CBFalconer wrote:[color=blue]
              > leorulez@gmail. com wrote:[color=green]
              > >
              > > The file does not exist. I need to create it. Like I said before it can
              > > be just a text file or excel or MS Access. All I need to do is check if
              > > col 2 and col 3 match with col 1.[/color]
              >
              > What file? There is no context, so who knows what you said
              > before. You must always include adequate context in a usenet
              > article. You can do this even with the foully broken Google usenet
              > interface by following the instructions in my sig below. Also read
              > the referenced URLs therein.[/color]

              LOL
              [color=blue]
              >
              > Google is NOT Usenet. There is no guarantee any reader can see any
              > previous messages, or in fact has ever received them. Thus any
              > article must stand by itself.
              >
              > --
              > "The power of the Executive to cast a man into prison without
              > formulating any charge known to the law, and particularly to
              > deny him the judgement of his peers, is in the highest degree
              > odious and is the foundation of all totalitarian government
              > whether Nazi or Communist." -- W. Churchill, Nov 21, 1943[/color]

              Comment

              • Vladimir S. Oka

                #8
                Re: reading a database file

                CBFalconer wrote:
                [color=blue]
                > leorulez@gmail. com wrote:[color=green]
                >>
                >> The file does not exist. I need to create it. Like I said before it
                >> can be just a text file or excel or MS Access. All I need to do is
                >> check if col 2 and col 3 match with col 1.[/color]
                >
                > What file? There is no context, so who knows what you said
                > before. You must always include adequate context in a usenet
                > article. You can do this even with the foully broken Google usenet
                > interface by following the instructions in my sig below. Also read
                > the referenced URLs therein.>[/color]

                Oh dear... I'll supply the missing bit, as it's still in my clipboard:

                "If you want to post a followup via groups.google.c om, don't use
                the broken "Reply" link at the bottom of the article. Click on
                "show options" at the top of the article, then click on the
                "Reply" at the bottom of the article headers." - Keith Thompson
                More details at: <http://cfaj.freeshell. org/google/>

                Cheers

                Vladimir

                --
                Just because everything is different doesn't mean anything has
                changed.
                -- Irene Peter

                Comment

                Working...