script that removes spaces between digits

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ted_drink_beer
Posts: 8
Joined: 30 May 2018, 03:28

script that removes spaces between digits

18 Sep 2018, 04:22

I need some help. I want to create a script that removes spaces between digits and is formatted after pasting it from the clipboard. Specifically from this example 1J0 127 401. I don't know how to do it :(
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: script that removes spaces between digits

18 Sep 2018, 08:02

Only spaces between digits or generally spaces?
With this code, which gets activated with F1, AHK checks if the Clipboard contains any spaces.
Just mark all the lines and press F1.

After that, you can post the new Clipboard with Ctrl+V.

Code: Select all

F1::
Send ^c ; Copy marked lines
ClipWait, 1 ; Wait until Clipboard contains data
Clipboard := StrReplace(Clipboard, CHR(32)) ; Remove spaces
return
If you need some special rule which should only apply to digits, you will have to modify the script.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 272 guests