Jump to content

saving text/string value to a file


Recommended Posts

Hi everyone,

I need your help again. Can someone please share a code that will save the value of a variable to a text file. Also, the text file should be overwritten everytime it gets executed, and it should NOT grow.

$myvar = "This is a sample string"

save it to c:\temp\mytemp.txt

Thanks,

Neil

Link to comment
Share on other sites

Hi everyone,

I need your help again. Can someone please share a code that will save the value of a variable to a text file. Also, the text file should be overwritten everytime it gets executed, and it should NOT grow.

$myvar = "This is a sample string"

save it to c:\temp\mytemp.txt

Thanks,

Neil

<{POST_SNAPBACK}>

I got it guys :)

$file = FileOpen("C:\testautoit.txt", 2)

FileWriteLine($file, "this is a test");

FileClose($file)

Link to comment
Share on other sites

  • 14 years later...
  • Developers
9 hours ago, pecsenye said:
this is useful!

 

This is an 14 years old thread you ressurected just for that?

Please don't!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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