KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Command to consolidate spaces
Topic Summary:
Created On: 04/08/2022 01:26 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Command to consolidate spaces   - wristofdoom - 04/08/2022 01:26 PM  
 Command to consolidate spaces   - ax - 04/08/2022 02:33 PM  
 Command to consolidate spaces   - R. Wilke - 04/08/2022 04:17 PM  
 Command to consolidate spaces   - dilligence - 04/10/2022 09:28 AM  
 Command to consolidate spaces   - wristofdoom - 04/11/2022 05:36 PM  
 Command to consolidate spaces   - Edgar - 04/10/2022 10:24 AM  
 Command to consolidate spaces   - ax - 04/11/2022 07:21 PM  
 Command to consolidate spaces   - R. Wilke - 04/12/2022 01:11 PM  
 Command to consolidate spaces   - PG LTU - 04/12/2022 12:34 PM  
 Command to consolidate spaces   - ax - 04/12/2022 08:16 PM  
 Command to consolidate spaces   - Lunis Orcutt - 04/13/2022 11:48 AM  
 Command to consolidate spaces   - PG LTU - 04/13/2022 04:46 PM  
 Command to consolidate spaces   - Matt_Chambers - 04/13/2022 05:49 PM  
 Command to consolidate spaces   - R. Wilke - 04/13/2022 08:06 PM  
Keyword
 04/08/2022 01:26 PM
User is offline View Users Profile Print this message

Author Icon
wristofdoom
Top-Tier Member

Posts: 326
Joined: 09/03/2020

I have a command called "consolidate that" that I use to get rid of extra spaces and linebreaks that are in the current selected text.

 

For example, if I had "this   example   text", I can select the text, under the command "consolidate that", and then the text becomes "this example text"

 

My current script:

 

https://pastebin.com/PUYa8QXu

 

The script that I have works but it is not very smart. Right now, I just search for instances of 4 back to back spaces, 3 spaces, 2 spaces, and consolidate all of that into a single space.

 

This works for almost all may use cases, but it won't work if I ever have a block of text with a                              lot                       of                                             spaces.

 

What I want to do is replace all instances of Space(x) where X = any number > 1, but I don't know how to express that in Visual Basic.

 

Any tips?

 



-------------------------

Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017.



Statistics
32324 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 347 guests browsing this forum, which makes a total of 347 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.