The scenario is to read the last but previous line of a PS file all the times.
i have explained two logics 1) the Count-1 logic, But the file may contain millions of record. 2) reading the PS file backwards, but No key will be specified for that file.
If anybody knows the optimized logic, please post here.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Why are the last 2 records needed?
If the file is huge (hundreds of millions of records or whatever) suggest that when the file is created, the process could create another little file that contains only the last 2 records. . . Or these 2 entries might be put in some database table . . . Or. . .