Jump to content

How can I rename something in a .txt file?


Recommended Posts

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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