Search code examples
clipboardtrimspaces

Remove spaces from a string of text in clipboard


This is maybe a weird request but hear me out:

I have a huge database at my shop containing product codes, like 87 445 G 6 which I need to check for availability on a supplier's website. The problem is, the supplier's website consists of a web form in which I have to enter the code without spaces, so imagine that I have to manually delete spaces every time I paste a code or write it manually without. I can't edit the database from which I copy the codes.

I wonder if some sort of plugin, script, or trick can be used directly in browser on the supplier's web form, or some software to modify how the windows clipboard works, maybe some option to copy text without spaces. Using Windows XP.


Solution

  • The OP has probably moved on, but for anyone else looking here, my approach was to tackle this from the windows clipboard side.

    For background: I keep a list of my credit card info in Keepass. Sometimes (poorly coded) shopping cart checkout forms don't like spaces in between card numbers. I like storing them with spaces since it's easier to read off that way.

    There's various Windows clipboard utilites out there, but it took me a while to find one that could do some processing on the clipboard contents and pasting it out - Clipboard Help and Spell

    The program has a way to "save" a bunch of text transformations, and even assign the action to a hotkey.

    For reference, my "Find and Replace" action is to find "\s" (without quotes) and leave the Replace textbox empty. "\s" will match whitespace character.