fRequEnCy Posted March 10, 2008 Share Posted March 10, 2008 (edited) What I'm trying to do is read from a txt file and write a Regular Expression to fix as followsWhat I have now is:File1 File Name1File2 File Name2What I want is: File1|File Name1File2|File Name2This is just an example.CODE$file = "C:\somefile.txt"$find = "(\w \s* \w)"$replace = "|";Return Value$retvalue = _ReplaceStringInFile($file, $find, $replace, 0, 1)If $retvalue = -1 Then MsgBox(0, "Error", "Pattern could not be found") ExitElse MsgBox(0, "Info", "Pattern found")EndIfPlease assist. Sorry for such a noob question but couldn't figure this out for nothing. Edited March 10, 2008 by fRequEnCy 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