Find and replace bullet points

Get help with using AutoHotkey and its commands and hotkeys
Tobister
Posts: 1
Joined: 13 Jul 2018, 08:56

Find and replace bullet points

13 Jul 2018, 09:06

Hi all,

as you can see, I am new to the community :) I encountered a challenge for which I was not able to find a solution to yet:

I have a text in a text processing editor like MS Word. I need to paste this text into a plattform which misinterprets carriage returns, new lines and bullet points. To edit the carriage returns and new lines, I have already built the following code which works fine:

Code: [Select all] [Download] GeSHi © Codebox Plus

		clipboard =  ; Start off empty
Sleep 200
Send ^c
Sleep 200
Clipboard := StrReplace(Clipboard,"`r`n","|*")
Sleep 200
Send, %clipboard%


Now my question: Does anyone of you know an idea of how to get this:
  • One
  • Two
  • Three

To
One|*Two|*Three


I could not find a string that I can search for when looking for a bullet point of a list. I already tried "\u2022".

Thank you so much
Tobi
Qysh
Posts: 143
Joined: 24 Apr 2018, 09:16

Re: Find and replace bullet points

13 Jul 2018, 12:34

Code: [Select all] [Download] GeSHi © Codebox Plus

	clipboard =  ; Start off empty
Sleep 200
Send ^c
Sleep 200
Clipboard := StrReplace(StrReplace(Clipboard,"•",""),"`r`n","|*")
Sleep 200
Send, %clipboard%
colt
Posts: 54
Joined: 04 Aug 2014, 23:12
Location: Portland Oregon

Re: Find and replace bullet points

13 Jul 2018, 12:53

Another way could be to strip your clipboard of all symbols except for |*. I am assuming that the text is only letters and numbers. This way if your bullet point style changes you will not have to rewrite your code.

Code: [Select all] [Download] GeSHi © Codebox Plus

output:= StrReplace(Clipboard,"`r`n","|*")
output:= RegExReplace(output, "i)[^0-9a-z|*]")
msgbox %output%
User avatar
jeeswg
Posts: 4970
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Find and replace bullet points

13 Jul 2018, 20:30

Try this. Cheers.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Ask For Help”

Who is online

Users browsing this forum: dot64, Exaskryz and 58 guests