topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 8:40 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Double to Single Space Converter  (Read 9120 times)

HOTGA

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 12
  • We code in peace - take us to your leader....
    • View Profile
    • Donate to Member
Double to Single Space Converter
« on: November 08, 2009, 11:05 PM »
Please can some one write a program to convert double and triple spaces in text copied from pdf's and word document to single space. I cut a lot of text from pdf documents into word tables and it always has double and sometimes triple spaces between the text and I have to do lots of find and replace in word to change double to single space (sometimes multiple times on the same piece of text) - use this program (http://www.freewareg...2007/07/04/clipcase/) "ClipCase" to try to this but it never works on the double spaces - HELP!!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Double to Single Space Converter
« Reply #1 on: November 08, 2009, 11:32 PM »
you can use a clipboard tool like my Clipboard Help+Spell and define a text formatting preset to do this; then just select your text and hit a hotkey and run the text formatter on it to do what you want.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Double to Single Space Converter
« Reply #2 on: November 09, 2009, 01:45 AM »
try this AHK script to replace the unwanted whitespaces with one single whitespace. use the win+alt+v hotkey to process the clipboard and paste the content.

#!v::
clipboard = %clipboard%   ; change to plain text
clipnospace := RegExReplace(clipboard, "` {2,}", "` ")
clipboard = %clipnospace%
Send ^v
Return

HOTGA

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 12
  • We code in peace - take us to your leader....
    • View Profile
    • Donate to Member
Re: Double to Single Space Converter
« Reply #3 on: November 09, 2009, 01:52 AM »
I have d/l'dclipboard help and spell - thanks - please tell me what type in the find and replace box of the modify format/case settings - I tried normal double space replaced with single - does not work, [:space:] replaced with [:space:][:space:] - does not work, [:space:]{2} replaced with normal space not luck! HELP (please)

HOTGA

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 12
  • We code in peace - take us to your leader....
    • View Profile
    • Donate to Member
Re: Double to Single Space Converter
« Reply #4 on: November 09, 2009, 02:14 AM »
Cheers lanux edited the script so my single key shortcut for puretext.exe also removes all double spaces! ace..thanks for your help too mouser!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Double to Single Space Converter
« Reply #5 on: November 09, 2009, 02:17 AM »
Ok here you go, the CHS screenshot configuration for the preset:
Screenshot - 11_9_2009 , 2_12_55 AM.png

Even easier, just unzip this preset.format file in your C:\Program Files (x86)\Clipboard Help+Spell\PresetFormats\ directory, restart CHS, and you should now have it available without having to create and save it yourself:
* MultiSpaceToSingle.preset.zip (0.66 kB - downloaded 252 times.)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Double to Single Space Converter
« Reply #6 on: November 09, 2009, 02:18 AM »
damn it lanux beat me to it :)

well.. at least this will be useful for those who feel like experimenting with CHS.