Jump to content

String Replace with @CRLF


Recommended Posts

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?

Link to comment
Share on other sites

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

#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

$rplcwith = StringReplace(InputBox("Replace","enter the Replacement string:"),"@CRLF",@CRLF)

That thing worked lyk a charm, thx man.. :D

lainline thank you too.. :huggles:

Edited by obscurant1st
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...