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

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2008
Posts: 4
Reputation: deerslayer is an unknown quantity at this point 
Solved Threads: 0
deerslayer deerslayer is offline Offline
Newbie Poster

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

 
0
  #1
Jan 24th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 2
Reputation: chamsups is an unknown quantity at this point 
Solved Threads: 0
chamsups chamsups is offline Offline
Newbie Poster

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

 
0
  #2
May 22nd, 2008
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

Originally Posted by deerslayer View Post
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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC