sosimple Posted March 30, 2007 Posted March 30, 2007 I have a .txt file . Somewhere in it , it has: password=blabla code=blublu How can I rename this to password=blabla2 code=blublu2 ? Perhaps I should use IniRenameSection command , but I cant find how? ...
flyingboz Posted March 30, 2007 Posted March 30, 2007 You have to edit the file. If the file format corresponds to INI format, then you can use IniWrite() to update a param. Natively, you would read the file into a variable, replace text as necessary, then write the modified variable contents to the old file name. Too scary? Write to a new file, then on success, backup or delete the previous file. There is also a UDF floating around that contains examples of how to get access to the file pointer, allowing for in-place file edits. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.
sosimple Posted March 30, 2007 Author Posted March 30, 2007 You have to edit the file. If the file format corresponds to INI format, then you can use IniWrite() to update a param.Natively, you would read the file into a variable, replace text as necessary, then write the modified variable contents to the old file name.Too scary? Write to a new file, then on success, backup or delete the previous file.There is also a UDF floating around that contains examples of how to get access to the file pointer, allowing for in-place file edits.Thanks, you were right. IniWrite() was very helpfull.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now