Jump to content

Recommended Posts

Posted

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? ...

Posted

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.

Posted

  flyingboz said:

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...