Count number of lines in a text file [message #80097] |
Sun, 11 August 2002 03:06 |
Sastry S. Peri
Messages: 1 Registered: August 2002
|
Junior Member |
|
|
Hi, In my application (Insurance based), i need to generate some text files of the payments to be made by the company to the clients and send these text files to banks for the payments to the client. I generate the file and after the bank does the payments, bank in return sends the file back with some additional flags.
when the file is received, say if the file contains 20lines, 19 lines will have the detailed information of the payment, 1 line for each payment and the last line and i update my table with the flags, 20th line contains the header info (like how many lines this file contain, the total sum of amounts of all the 19lines above etc etc) and the update to the tables, th fields are differnt here for this line.
What i planned is: Count number of lines, in the file, when its the last line, then do the processing accordingly. But I dont know how to count the number of lines. Could somebody let me know how to do this or if you have any alternative suggestion do kinldy let me know.
Regards
Sastry S. Peri
|
|
|
|