473,396 Members | 2,002 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,396 software developers and data experts.

data from a csv file

hello all,
i've to write a C code to read data from an excel sheet (in CSV format) into a 2 dimensional array.
the csv file has 100 columns and 5000 rows.
but i am supposed to read in only 19 of these 100 columns.
the 19 columns which i require are D, E, P, W, BC, BD, BO, CU, CV, etc.
so you can see that the required columns do not occur together in the original excel file.
can someone help me out?

thanks.
madhan
Jan 20 '07 #1
4 1667
Banfa
9,065 Expert Mod 8TB
How far have you got?
Can you open the file an read it line by line?
Once you can you are left with the problem of parsing the lines into their cell valules.
Jan 22 '07 #2
hi
i m a user of turbo c.
could u plz guide me how to read data from an excel sheet or any other text file
how to read the file in array.
Jan 22 '07 #3
Hi!
Can u plz guide me how to read data from the excell sheet. please share the Code if u please allow.
Jan 22 '07 #4
DeMan
1,806 1GB
I assume you know that a csv file stores cells of data as text (sometimes in quotation marks, depending on content) delimited by a comma?

This means you can read in the file line, by line, splitting it each time you come accross a comma.

Obviously, there is an order to the cells - D is 4th, E 5th, P 16th, W 22nd, BC 81st (I think) and the CU, CV are outside the 100 columns you mention.
Either way, you set a loop to parse each line only storing the 4th, 5th, 16th etc value (and don't worry an empty cell IS still delimited by a comma).
Jan 22 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Pieter Edelman | last post by:
Hi all, I'm trying to submit some data using a POST request to a HTTP server with BASIC authentication with python, but I can't get it to work. Since it's driving me completely nuts, so here's...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.