473,378 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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.

Feb 3 '06 #1
7 1651
le******@gmail.com wrote:
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.

--
Ian Collins.
Feb 3 '06 #2
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.

Feb 4 '06 #3
le******@gmail.com wrote:
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.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Feb 4 '06 #4
le******@gmail.com wrote:
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.

--
Ian Collins.
Feb 4 '06 #5
le******@gmail.com wrote:

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
Feb 5 '06 #6

CBFalconer wrote:
le******@gmail.com wrote:

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.


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


Feb 5 '06 #7
CBFalconer wrote:
le******@gmail.com wrote:

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


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

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

Feb 5 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and...
14
by: Erik Andersson | last post by:
Hi! I need to read a file (line-by-line) in reverse order, without reading the whole file into memory first. Is there an easy way of doing this? As in, is there a PHP function I could use? ...
2
by: opt_inf_env | last post by:
Hello, I would like to solve the following problem. On the server side I have a file with a sequence of natural numbers (1, 2, 3, 4, 5, ...., n). Each user, after some action, adds new number...
0
by: Andy | last post by:
Hi, In the code below (not pretty I know but it's an early version :-P) I'm having problems reading the data object back in. If I move the reading code to immediately after the section where it...
2
by: Roland Hall | last post by:
I have two(2) issues. I'm experiencing a little difficulty and having to resort to a work around. I already found one bug, although stated the bug was only in ODBC, which I'm not using. It...
4
by: Andy | last post by:
Hello All: I have a field in the database that is an Image. I have no idea how the data is stored in here (Image, compressed, encrypted, plain text, etc). I am trying to write the contents to...
7
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
7
by: ianenis.tiryaki | last post by:
well i got this assignment which i dont even have a clue what i am supposed to do. it is about reading me data from the file and load them into a parallel array here is the question: Step (1) ...
2
by: Derik | last post by:
I've got a XML file I read using a file_get_contents and turn into a simpleXML node every time index.php loads. I suspect this is causing a noticeable lag in my page-execution time. (Or the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.