How to update one row in a exsiting Text File

I need example code on how to “update” only one row in existing text file using Lotus script agent.Any help will be greatly appreciate.

Subject: Depends…

If your text file consists of records of the same size then you could use random access methods (Open xyz.txt For Random…etc). Otherwise I think you need to read each line one by one into a string buffer until you come to the line you want to update, write the updated contents to the buffer instead of that line, then read the rest of the lines into the buffer. Then write it all back out to the file. Pretty tedious stuff but that’s the price you pay for using a simple but flexible data format.

Subject: Question

Thank you for your response. My text file has about six thousand rows with five fields value. These values are at fix length(20 chars apart). My task is, at the completion of export data to text file, goto to row number one and rewrite the row values. Do you have any sample code by chance?

Subject: How to update one row in a exsiting Text File

Thank you for your response. My text file has about six thousand rows with five fields value. These values are at fix length(20 chars apart). My task is, at the completion of export data to text file, goto to row number one and rewrite the row values. Do you have any sample code by chance?

Subject: How to update one row in a existing Text File

Are you doing the export in script or using File Export of a view?