954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Open, search, replace data, save, close .txt file

Forwarn I am a newbe to the coding word!

I am writing an application to open a 'machine code' file, in .txt format, to edit a value, save and close the file to the same directory. I have been successfull using a listbox to show all files, with the correct extension, and allowing the user to 'selecteditems' open the file and display the entire .txt file in a textbox. What I would like to do is to only show in a textbox the value of the variable to be changed, add a second textbox to enter the new value and replaced the old, save and close file to the same directory.

Does anyone have direction on performing this task of only two textboxes and changing data, from a search, in a .txt file? Thanks for the help and direction....

If I had to guess, I would say I need to add an object with a loop statement to parse through the .txt file finding the variable I want to change?

deerslayer
Newbie Poster
4 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

I need to do something like this also....I have to read a file, then add new entries, search for input values......So if U have already done this code...could u post it up with all the classes
thanks

Forwarn I am a newbe to the coding word!

I am writing an application to open a 'machine code' file, in .txt format, to edit a value, save and close the file to the same directory. I have been successfull using a listbox to show all files, with the correct extension, and allowing the user to 'selecteditems' open the file and display the entire .txt file in a textbox. What I would like to do is to only show in a textbox the value of the variable to be changed, add a second textbox to enter the new value and replaced the old, save and close file to the same directory.

Does anyone have direction on performing this task of only two textboxes and changing data, from a search, in a .txt file? Thanks for the help and direction....

If I had to guess, I would say I need to add an object with a loop statement to parse through the .txt file finding the variable I want to change?

chamsups
Newbie Poster
2 posts since May 2008
Reputation Points: 9
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You