how to replace a word or , or bracket
-
- Posts: 42
- Joined: Feb 2nd, ’20, 08:36
could u please advise.
I sometimes copy text from the web, and want to paste it in a folder; but i want to have an option to remove certain words like "Default or Beta or Multi or etc" and also remove " .,[]{}()-_ "
And want to replace these with " SPACE "
eg:- John.2021_Multi-Smith => John 2021 Smith
thx in advance
I sometimes copy text from the web, and want to paste it in a folder; but i want to have an option to remove certain words like "Default or Beta or Multi or etc" and also remove " .,[]{}()-_ "
And want to replace these with " SPACE "
eg:- John.2021_Multi-Smith => John 2021 Smith
thx in advance
Something like this?
Code: Select all
string:=Clipboard
replacements:=".;,;[;];{;};(;);-;_;Default;Beta;Multi;etc"
loop, parse, replacements, `;
StringReplace, string, string, %A_LoopField%, %A_Space%, all
loop
StringReplace, string, string, %A_Space%%A_Space%,%A_Space%, UseErrorLevel
until !ErrorLevel
sendinput, % string
-
- Posts: 42
- Joined: Feb 2nd, ’20, 08:36
thx Tom,Tom wrote: ↑Oct 17th, ’21, 10:16 Something like this?Code: Select all
string:=Clipboard replacements:=".;,;[;];{;};(;);-;_;Default;Beta;Multi;etc" loop, parse, replacements, `; StringReplace, string, string, %A_LoopField%, %A_Space%, all loop StringReplace, string, string, %A_Space%%A_Space%,%A_Space%, UseErrorLevel until !ErrorLevel sendinput, % string
can u please adjust it also to remove " ; " & "the space at the end"
a space is being added to the end
Code: Select all
string:=Clipboard
replacements:=",|.|,|[|]|{|}|(|)|-|_|Default|Beta|Multi|etc"
loop, parse, replacements, |
StringReplace, string, string, %A_LoopField%, %A_Space%, all
loop
StringReplace, string, string, %A_Space%%A_Space%,%A_Space%, UseErrorLevel
until !ErrorLevel
string=%string%
sendinput, % string
-
- Posts: 42
- Joined: Feb 2nd, ’20, 08:36
PERFECTTom wrote: ↑Oct 17th, ’21, 12:31Code: Select all
string:=Clipboard replacements:=",|.|,|[|]|{|}|(|)|-|_|Default|Beta|Multi|etc" loop, parse, replacements, | StringReplace, string, string, %A_LoopField%, %A_Space%, all loop StringReplace, string, string, %A_Space%%A_Space%,%A_Space%, UseErrorLevel until !ErrorLevel string=%string% sendinput, % string
THX
-
- Posts: 42
- Joined: Feb 2nd, ’20, 08:36
can the result be saved in the clipboard
instead of opening notepad and pasting the result there
thx again
instead of opening notepad and pasting the result there
thx again
Replace the last line with
Clipboard:=String
Clipboard:=String