reading a database file

L

leorulez

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.
 
I

Ian Collins

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.
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.
 
L

leorulez

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.
 
J

Joe Wright

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.
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.
 
I

Ian Collins

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.
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.
 
C

CBFalconer

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.

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
 
M

mensanator

CBFalconer said:
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.
LOL


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
 
V

Vladimir S. Oka

CBFalconer said:
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.>

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.com, 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top