Hello,
i need to know what code to use for editing certain parts of a .cfg or .txt file.
I want it to find a certain string and replace it.
Thankyou
Printable View
Hello,
i need to know what code to use for editing certain parts of a .cfg or .txt file.
I want it to find a certain string and replace it.
Thankyou
do a search in the forum, or look in the codebank
Read the file into a textbox, make your changes, and save it back out overlaying the original.
Here Is Something That I Made :D Hope Its Usefull
Code:Private Sub btnLoad_Click()
FF = FreeFile
Open "C:\Test.txt" For Input As #FF ' Or You Can Try "C:\Test.cfg" Or Choose Other Path
Input #FF, TextOfFile
txtFile.Text = TextOfFile
Close #FF
End Sub
Private Sub btnSave_Click()
FF = FreeFile
Open "C:\Test.txt" For Output As #FF ' Or You Can Try "C:\Test.cfg" Or Choose Other Path
Print #FF, txtFile.Text
Close #FF
End Sub