how to manipulate .csv file

R

royzlife

I want to get some win32 api's which would be able to read/write/
open/
close a .csv fileand store the content in a structure. Can any one
help me out with such apis in C ?
 
R

Richard Heathfield

(e-mail address removed) said:
I want to get some win32 api's which would be able to read/write/
open/
close a .csv fileand store the content in a structure. Can any one
help me out with such apis in C ?

The technique is well-documented in the literature, and there are plenty
of libraries out there.
 
R

royzlife

Hi Richard,
I would like to know wat win32 apis are there which can be used to
retreive/set the data from/to a csv file!
 
R

Richard Heathfield

(e-mail address removed) said:
Hi Richard,
I would like to know wat win32 apis are there which can be used to
retreive/set the data from/to a csv file!

If you're determined to use non-portable Win32 APIs rather than a fully
portable library, that's your prerogative, of course - in which case I
suggest you ask in comp.os.ms-windows.programmer.win32 where the
Windows programming experts hang out. They are far more likely to give
you an authoritative answer, and any mistakes in answers you receive
are far more likely to be corrected.
 
M

Malcolm McLean

Hi Richard,
I would like to know wat win32 apis are there which can be used to
retreive/set the data from/to a csv file!
The might be a Windows only api for loading CSV files.
However there is no reason at all why the bulk of the work cannot be done in
ANSI C, with only the final dispaly of data to the user Windows-specific.

If you look on my website you will find a CSV to struct converter. However
it can only spit out C code to be compiled with a compiler. There is no way
of creating struct types at runtime in C.However you don't need them - the
CSV loader has functions to retrieve data by row and column, and to query
column names.
 
M

Mark McIntyre

On Tue, 19 Jun 2007 06:55:44 -0700, in comp.lang.c ,
Hi Richard,
I would like to know wat win32 apis are there which can be used to
retreive/set the data from/to a csv file!

A csv file is just a text file, you don't need special Win32 API calls
to manage them. I doubt that any exist, in fact , since the APIs are
to do with Windows, not text files.

Meantime STFW. The wikipedia entry even contains some relevant
external links, for once. Once you know the format, writing a tool to
read in the data is fairly simple.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
R

Robert Gamble

I want to get some win32 api's which would be able to read/write/
open/
close a .csv fileand store the content in a structure. Can any one
help me out with such apis in C ?

This can be done in portable C without resorting to system-specific
APIs. I have written a portable CSV library that can quickly parse
and write CSV data as well as a set of end-user tools that uses this
library to manipulate CSV files. Both are written in ANSI C and are
OSS:

http://sourceforge.net/projects/libcsv/
http://sourceforge.net/projects/csvutils/

Robert Gamble
 
H

Hyuga

I want to get some win32 api's which would be able to read/write/
open/
close a .csv fileand store the content in a structure. Can any one
help me out with such apis in C ?

Aww, I thought this post was going to consist of handy tips on how to
manipulate CSV files.

I realize that not everyone on USENET is a native English speaker, and
that's fine. I'm sure I've said some ridiculous things in Japanese.
But this "how to ______" structure for asking questions is common it
really grates me.

Instead use "How does one....?" or "How do I....?" or "Does anyone
know anything about doing ....?"

Just saying "how to ...." suggests that you are giving an explanation
on how to do whatever is in the '....'.

Sorry to go all grammar nazi on this thread, but I just can't hold my
tongue on this subject any longer.

Hyuga
 

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
474,263
Messages
2,571,061
Members
48,769
Latest member
Clifft

Latest Threads

Top