Thread View: borland.public.cppbuilder.deployment
9 messages
9 total messages
Started by didan
Tue, 22 Mar 2005 16:33
read and write text file
Author: didan
Date: Tue, 22 Mar 2005 16:33
Date: Tue, 22 Mar 2005 16:33
3 lines
848 bytes
848 bytes
For a 30M data file, what is the fast way to read and write it? Thanks
Re: read and write text file
Author: Hans Galema
Date: Tue, 22 Mar 2005 17:26
Date: Tue, 22 Mar 2005 17:26
8 lines
1104 bytes
1104 bytes
didan wrote: > For a 30M data file, what is the fast way to read and write it? Probably fopen(), fread(), fwrite(), ftell() ... Do you want to do specific actions ? Hans.
Re: read and write text file
Author: didan
Date: Tue, 22 Mar 2005 18:50
Date: Tue, 22 Mar 2005 18:50
12 lines
1206 bytes
1206 bytes
Seems the file is too big. I didn't get any error, but I couldn't read anything. Do you have any experience on reading big files? Thanks Hans Galema <notused@notused.nl> wrote: >didan wrote: >> For a 30M data file, what is the fast way to read and write it? > >Probably fopen(), fread(), fwrite(), ftell() ... > >Do you want to do specific actions ? > >Hans.
Re: read and write text file
Author: Hans Galema
Date: Tue, 22 Mar 2005 19:14
Date: Tue, 22 Mar 2005 19:14
7 lines
1313 bytes
1313 bytes
didan wrote: > Seems the file is too big. I didn't get any error, but I couldn't read anything. Do you have any experience on reading big files? Thanks Why does it seem to big ? Yes I regularly read such bigs files. What is the problem ? Hans.
Re: read and write text file
Author: didan
Date: Tue, 22 Mar 2005 21:37
Date: Tue, 22 Mar 2005 21:37
11 lines
1335 bytes
1335 bytes
I don't know why. It works now. but it takes about 10 second to read it. How to speed up? Hans Galema <notused@notused.nl> wrote: >didan wrote: >> Seems the file is too big. I didn't get any error, but I couldn't read anything. Do you have any experience on reading big files? Thanks > >Why does it seem to big ? Yes I regularly read such bigs files. >What is the problem ? > >Hans.
Re: read and write text file
Author: Thomas Maeder [TeamB]
Date: Tue, 22 Mar 2005 21:51
Date: Tue, 22 Mar 2005 21:51
9 lines
1447 bytes
1447 bytes
"didan" <relaxandfree@yahoo.com> writes: > I don't know why. It works now. but it takes about 10 second to read > it. How to speed up? You post a lot of questions and very little information. Please show us the (*minimal*) slow code. We can then try to improve on it.
Re: read and write text file
Author: didan
Date: Wed, 23 Mar 2005 21:45
Date: Wed, 23 Mar 2005 21:45
17 lines
1488 bytes
1488 bytes
here is the code fPtr = fopen(fileName,"r") fscanf(fPtr,"%f", &data) is there any better way to read a file? maeder@glue.ch (Thomas Maeder [TeamB]) wrote: >"didan" <relaxandfree@yahoo.com> writes: > >> I don't know why. It works now. but it takes about 10 second to read >> it. How to speed up? > >You post a lot of questions and very little information. > >Please show us the (*minimal*) slow code. We can then try to improve >on it.
Re: read and write text file
Author: Hans Galema
Date: Wed, 23 Mar 2005 22:15
Date: Wed, 23 Mar 2005 22:15
14 lines
1369 bytes
1369 bytes
didan wrote: > here is the code > fPtr = fopen(fileName,"r") > fscanf(fPtr,"%f", &data) With one fscanf you will not read 30 MB. You should show a complete loop. And all the types of the variables. You should also tell of course how the datafile is build up. Hans.
Re: read and write text file
Author: Ed Mulroy [TeamB]
Date: Thu, 24 Mar 2005 03:32
Date: Thu, 24 Mar 2005 03:32
15 lines
1333 bytes
1333 bytes
FYI: That code does not have anything to check if the returned FILE * value is NULL. You really should test it before using it. . Ed > didan wrote in message > news:4241e36f$1@newsgroups.borland.com... > > here is the code > fPtr = fopen(fileName,"r") > fscanf(fPtr,"%f", &data) > > is there any better way to read a file?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads