Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FSO Editting

Status
Not open for further replies.

Javamahn

Technical User
Mar 14, 2001
143
US
I am reading a pipe delimited text file into a repeating form table. I am using OpenTextFile ForReading method of retrieval.
The Form opens. There are 3 sections of the delimited text (ie. FirstName | MiddleName | LastName) being split at the pipe and fed into each of 3 text fields. The 3 text fields Repeat as long as the data is NOT AtEndofStream. A submit button and then the form closes.

What steps do I now need to take to be able to update the text fields and then write all of the new info back to the text file?

My guess is I first need to setup a counter and add that as part of the input name so as to make data collection easier. If there is a better, less kludgy way I would be thankful to know that method.

Thanks in advance
 
The less-than-kludgy way is to use a database instead of a text file.


Is a "repeating form table" a technical term for something I don't know about, or is it a description of the fact that your script is building a table with fields in a form?


Is someone using the form to "update the text fields", that is the names? And then you want to save them?


The Request.Form collection will provide all of the values in nice order whether you number them or not. Well assuming that you write the same number of fields for first, middle, and last names. If so I think it is safe to assume that
Request.Form("firstname").Item(6) goes with
Request.Form("lastname").Item(6)


Finally, I am not aware that there is a random access type of file available in ASP, but there might be. Certainly the TextStreamObject is not a random access file. So there is little point in knowing which fields were changed because you must write the whole file to save the changes.

I hope these comments are helpful. I will be interested to learn whether there is something like a random access file available to ASP.

 
Thanx,

It was a description of the fact that the script is building a table with fields in a form?


I think I figured it out using the Request.form and a few replace() string manipulations to rewrite the entire text file. It looks as if thats what you were suggesting as a solution. I just had to knock the idea out from the cobwebs in my head.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top