|
-
April 8th, 1999, 02:17 AM
#1
csv
Hi
What do i need to read a .csv file eg. produced by MS Exel ?
Thanks in advance.
Steen
-
April 8th, 1999, 03:23 AM
#2
Re: csv
This is very simple, a CSV File produced by Excel has columns which are seperated by ;
So just open that file like:
FILE *stream;
char Data[1024];
CString temp;
if( ( stream = fopen( "file.csv", "rt" ) )
{
for( ;; )
{
memset( data, 0, 1024 );
fgets( data, 1024, stream );
if( feof( stream ) ) break;
// if you are here, one line of text is in data
// now produce some code which reads each column of that stream, e.g.: getColumn( ";", data, n, &temp );
}
fclose( stream );
}
good luck !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|