Moonwaltz Posted April 6, 2006 Share Posted April 6, 2006 here is my code so far ; SET PATH FileChangeDir("C:\Program Files\Nortel Networks") ; SET VARIABLES $myfile = "baynet.tbk" $file = FileRead($myfile, FileGetSize($myfile)) $file = StringSplit($file, @CRLF, 1) ; NO FILE OPEN If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; IDENTIFY VALUE AND WRITE LINE for $i = 0 to $file[0] Step 1 If StringInStr($file[$i], "server=") Then _FileWritetoLine($myfile, $i, "my entry", 1) EndIf Next I pulled most of this from another similar post. I have two problems actually. 1st: the string to identify starts with server= but could have an ip or name after it that needs to be replaced with my data 2nd: _filewritetoline keeps causing an unknown function error I am running AutoIt v3 Link to comment Share on other sites More sharing options...
Valuater Posted April 6, 2006 Share Posted April 6, 2006 _filewritetoline is a udf thats needs to be placed in the include folder and #include that file at the top of your script 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 6, 2006 Moderators Share Posted April 6, 2006 You need to use beta for _FileWriteToLine() and the Beta #include <file.au3> Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted April 6, 2006 Share Posted April 6, 2006 You need to use beta for _FileWriteToLine() and the Beta #include <file.au3>cool... i didn't know it was in the File.au38) Link to comment Share on other sites More sharing options...
Moonwaltz Posted April 6, 2006 Author Share Posted April 6, 2006 I installed the beta, added #incude <file.au3>, and copied the file.au3 from the beta folder to the 3.1 include folder and all is good. Thanks for all the help Link to comment Share on other sites More sharing options...
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