obscurant1st Posted February 3, 2010 Share Posted February 3, 2010 Hi I am coding a script so that i can replace any given character which will be present in the clipboard, with any character. the script is here. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=oDx #AutoIt3Wrapper_Res_Description=- obscurant1st.biz #AutoIt3Wrapper_Res_Fileversion=1.0.0.3 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ClipBoard.au3> Dim $text, $toberplcd, $rplcwith, $modText MsgBox(0,"Info","Copy the Text to ClipBoard!!!") $text = _ClipBoard_GetData($CF_TEXT) $toberplcd = InputBox("Replace","enter the string to be replaced:") $rplcwith = InputBox("Replace","enter the Replacement string:") $modText = StringReplace($text,$toberplcd,$rplcwith) _ClipBoard_SetData($modText) But here when i try to replace any character lets say ";" with @CRLF it simply replaces the ; by @CRLF, but i need the new line character, so that when i paste the content of the clipboard, all ; will become new lines. So is there any way of doing this. I mean is there any way of replacing a character with new line character? [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
Mison Posted February 3, 2010 Share Posted February 3, 2010 Here's what i got so far: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=oDx #AutoIt3Wrapper_Res_Description=- obscurant1st.biz #AutoIt3Wrapper_Res_Fileversion=1.0.0.3 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ClipBoard.au3> Dim $text, $toberplcd, $rplcwith, $modText MsgBox(0,"Info","Copy the Text to ClipBoard!!!") $text = _ClipBoard_GetData($CF_TEXT) $toberplcd = InputBox("Replace","enter the string to be replaced:") $rplcwith = StringReplace(InputBox("Replace","enter the Replacement string:"),"@CRLF",@CRLF) $modText = StringReplace($text,$toberplcd,$rplcwith) _ClipBoard_SetData($modText) Hi ;) Link to comment Share on other sites More sharing options...
lainline Posted February 3, 2010 Share Posted February 3, 2010 #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=oDx #AutoIt3Wrapper_Res_Description=- obscurant1st.biz #AutoIt3Wrapper_Res_Fileversion=1.0.0.3 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ClipBoard.au3> Dim $text, $toberplcd, $rplcwith, $modText MsgBox(0,"Info","Copy the Text to ClipBoard!!!") $text = _ClipBoard_GetData($CF_TEXT) $toberplcd = InputBox("Replace","enter the string to be replaced:") $rplcwith = InputBox("Replace","enter the Replacement string:") $rplcwith = StringReplace($rplcwith,"@CRLF",@CRLF) $modText = StringReplace($text,$toberplcd,$rplcwith) _ClipBoard_SetData($modText) Link to comment Share on other sites More sharing options...
obscurant1st Posted February 3, 2010 Author Share Posted February 3, 2010 (edited) $rplcwith = StringReplace(InputBox("Replace","enter the Replacement string:"),"@CRLF",@CRLF) That thing worked lyk a charm, thx man.. lainline thank you too.. Edited February 3, 2010 by obscurant1st [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
Mison Posted February 3, 2010 Share Posted February 3, 2010 That thing worked lyk a charm, thx man.. lainline thank you too.. You're welcome. Hi ;) 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