-
October 4th, 2006, 08:41 AM
#1
File handling in mfc's(previous record)
Hi,
How to access the previous record from a file in MFC's.
For example we are reading data from a file and after reading some records if we want to read the previous record, then how can we to this.
and how can we directly read the last record from the file.
If we use SeekToEnd() we are going to the end of the file and not able to read the last record.
Even I am not able to read the file record by record.For that I am reading the file upto a new line character occurs and then using Seek to move the pointer.
Here I am assuming each line as a new record.
Please help me.Give some examples.
Thank you.
Last edited by rajeswaridevi; October 5th, 2006 at 12:20 AM.
-
October 4th, 2006, 09:01 AM
#2
Re: File handling in mfc's(previous record)
What do you mean by "record"?
-
October 4th, 2006, 11:25 AM
#3
Re: File handling in mfc's(previous record)
You cannot do this if you have a variable record size (i.e. number of bytes in the record). Otherwise if you have a fixed record size (i.e. each record containing a predefined number of bytes), then you can supply the bytes offset to find a particular record and read.
If there is no love sun won't shine
-
October 4th, 2006, 11:54 AM
#4
Re: File handling in mfc's(previous record)
Are you handling Flat file ?
Originally Posted by rajeswaridevi
Even I am not able to read the file record by record.For that I am reading the file upto a new line character occurs
I think you are assuming a line read from file as a record :-?
what are trying to do ?
Thanks
Rajesh.
-
October 5th, 2006, 12:21 AM
#5
Re: File handling in mfc's(previous record)
HI,
Here I am assuming each line as a new record. And each line is of vaiable length.
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
|