daywalkereg Posted August 2, 2007 Share Posted August 2, 2007 i want to tell the program "if" string found replace it with another something like IF string =" " found Then stringreplace(" ") Endif please help 1 £0\\/3 |-|3® $0 |\\/|µ(|-| Link to comment Share on other sites More sharing options...
lordofthestrings Posted August 2, 2007 Share Posted August 2, 2007 $string="test" If StringInStr($string, "es") Then $string = StringReplace($string, "es", "oe") EndIf ConsoleWrite('@@ Debug(' & _ ') : $string = ' & _ $string & @crlf & _ '>Error code: ' & @error) Link to comment Share on other sites More sharing options...
daywalkereg Posted August 2, 2007 Author Share Posted August 2, 2007 (edited) thanx lord but i have another 2 problems 1- that i cant copy or move the so called translated filename to given dir because the program give only file name 2- how can i get full path of the files in FileFindFirstFile function any ideas Edited August 2, 2007 by daywalkereg 1 £0\\/3 |-|3® $0 |\\/|µ(|-| Link to comment Share on other sites More sharing options...
lordofthestrings Posted August 2, 2007 Share Posted August 2, 2007 (edited) you can append the full path to the file like you append strings to another string.. first you have to check if the path to the file contains spaces. $string="test" $path="c:\test 123" If StringInStr($string, "es") Then $string = StringReplace($string, "es", "oe") EndIf ConsoleWrite('@@ Debug(' & _ ') : $string = ' & _ $string & @crlf & _ '>Error code: ' & @error) if StringInStr($path, " ") Then $path = '"' & $path & '"' EndIf run(@ComSpec & " /C echo " & $path & " & pause") you could also use the @ScriptFullPath macro Edited August 2, 2007 by lordofthestrings Link to comment Share on other sites More sharing options...
daywalkereg Posted August 2, 2007 Author Share Posted August 2, 2007 ok i made it any idias how to save it with the new name 1 £0\\/3 |-|3® $0 |\\/|µ(|-| Link to comment Share on other sites More sharing options...
lordofthestrings Posted August 3, 2007 Share Posted August 3, 2007 that would be a matter of simple logic: this piece should demonstrate how I would do it.. $newpath = @ScriptDir & '\test.txt' $Handle = FileOpen($newpath, 1) FileWriteLine($Handle, "I just created this new file under the newpath") FileClose($Handle) 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