Sign in to follow this  
Followers 0
jafuuu

How I can do this?

4 posts in this topic

Hi, thanks for read (:

I'm working in a Script, and I have a question:

How I can get get information from other file (a *.txt,*.bat or any other files easily to modificate!)

From example:

I wrote in a notepad file this:

Notepad.txt

x=myname

How I get the "x" valor from the notepad (or any other) filea and put in AutoIT?

Example:

MyScript.au3

ShellExecute ("(GET THE VALOR "X" FROM NOTEPAD.TXT).hi5.com")
etc..
etc..
etc..

Any Ideas?, I think this is possible >_

Share this post


Link to post
Share on other sites



How I get the "x" valor from the notepad (or any other) filea and put in AutoIT?

One possible solution is to use _FileReadToArray, then StringSplit with "=" as delimiter and use the required array element to construct your ShellExecute, something like
ShellExecute("any prepended text" & $aNotepadStringSplit[1] & ".any ext", "", @ScriptDir)
See the help file for some good examples.

Share this post


Link to post
Share on other sites

One possible solution is to use _FileReadToArray, then StringSplit with "=" as delimiter and use the required array element to construct your ShellExecute, something like

ShellExecute("any prepended text" & $aNotepadStringSplit[1] & ".any ext", "", @ScriptDir)
See the help file for some good examples.

Thanks for your answer, but, Can you explain me better?, whit any example, I'm so noob :$ !

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

There is very nice set of functions that works with .ini files.

If you make file notepad.ini

[values]
x=myname

Then you can get it with:

IniRead("notepad.ini","values","x","")

Writing is just as easy, as above - see help file.

Edited by Rarst

Share this post


Link to post
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
Sign in to follow this  
Followers 0