Zoltan_Gyimesi
Legendary Poster
Hi List/Forum,
I would like to read one line at a time from a flat file. I created a C++ BSFN using B34A1010 BSFN as a sample.
I have just one unresolved problem:
How to read one line at a time with "fscanf" standard C function.
The input line can contain space and tab characters and "fscanf" always read up to the first space, tab or newline and not only up to the new line only.
Here is my basic line:
fscanf(fpFile, "%s", lpDS->szRecord);
Can I accompish this task with fscanf somehow or do I have to create a while cycle reading the file char by char up to new-line and concatenate the characters in the output parameter?
Please help!
Any solution, sample code, advise will be highly appreciated!
Zoltán
PS1: Once upon a time (many many years ago) I have written a bunch of C codes under very old version of C but never used standard C functions because we have written our own to be able to be independent (mainly for critical error handling). Do not ask how many years ago!
PS2: I could be back to the Forum earlier on 24 or 25 in October.
Bye
B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
I would like to read one line at a time from a flat file. I created a C++ BSFN using B34A1010 BSFN as a sample.
I have just one unresolved problem:
How to read one line at a time with "fscanf" standard C function.
The input line can contain space and tab characters and "fscanf" always read up to the first space, tab or newline and not only up to the new line only.
Here is my basic line:
fscanf(fpFile, "%s", lpDS->szRecord);
Can I accompish this task with fscanf somehow or do I have to create a while cycle reading the file char by char up to new-line and concatenate the characters in the output parameter?
Please help!
Any solution, sample code, advise will be highly appreciated!
Zoltán
PS1: Once upon a time (many many years ago) I have written a bunch of C codes under very old version of C but never used standard C functions because we have written our own to be able to be independent (mainly for critical error handling). Do not ask how many years ago!
PS2: I could be back to the Forum earlier on 24 or 25 in October.
Bye
B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)