Cut/Copy Append...

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Bonzo

Cut/Copy Append...

Post by Bonzo »

This may be a feature request, unless someone has the quick answer :-)

I often find I need to Cut/Copy several 'bits' of text... say names in an HTML <select/> <option/>'s list, or variables, or 'rows' of data.... to paste elsewhere. I could cut/copy each bit, and paste immediately, but this is often a pain, if in another document, or say 2,000 lines above/below in the same document.

What I would really like, is the ability to Cut/Copy Append... BUT, Append a new line/carriage return character after (or before) each entry...

Without the line, it can be quite tricky to separate the values after...

Is there a way of doing this in TextPad?

I tried setting up a tool, that past in the "selected text" to a DOS batch file, which wrote (appended) the snip to a scratch file, with a line feed... but DOS doesn't always like the spaces in the text I copy, and when I'm done, I have to open the other file, to copy it, and paste it back where I need it.

Anyone have any slick ideas on how to handle this?

Cheers,

Bonzo
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

You know the EditCopyAppend (Ctrl-Shift-C) and EditCutAppend (Ctrl-Shift-X) commands in Textpad?
Bonzo

Post by Bonzo »

Yeah, but I Neeeeed the line break... (or the ability to set whether one is added or not.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

So what is stopping you from selecting a linebreak and EditCopyAppend it when you want it?
Bonzo

Post by Bonzo »

Okay, maybe I need to explain better...

Lets say I have:

Code: Select all

<select name="foo" size="8">
  <option value="1">Red Stuff</option>
  <option value="2">Orange Stuff</option>
  <option value="3">Yellow Stuff</option>
  <option value="4">Green Stuff</option>
  <option value="5">Blue Stuff</option>
  <option value="6">Indigo Stuff</option>
  <option value="7">Violet Stuff</option>
</select>
(add another 20+ values... I've truncated the sample list)

So, what I want, is to copy all the internal values out, with a line feed, so that I have:

Code: Select all

Red Stuff
Orange Stuff
Yellow Stuff
Green Stuff
Blue Stuff
Indigo Stuff
Violet Stuff
...
I could, as you suggested, copy one item, then copy a line feed from somewhere else, then the next, then a line feed, then... but now this doubles the number of things I need to select, and copy... and selecting a line feed isn't the easiest thing to do... :-(

As mentioned, I have a DOS batch file that is currently helping me, but this seems like such an easy thing... ;-)

If there isn't a way to do it currently, then I think I'll mention this to Helios as a Feature Request, to either toggle adding a line break, or have a duplicate command, with the line break option.

Cheers,

Bonzo
Ben

Post by Ben »

Turn block select mode before you copy.
Ben

Post by Ben »

That is: turn _on_ block select mode before you copy.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Copy the complete option lines and replace the tags by nothing...
Bonzo
Posts: 8
Joined: Tue Apr 22, 2003 1:01 pm

Post by Bonzo »

I guess I'm not being clear enough....

What I need, is a "copy append" command, that either by configuration, or by a macro, or by whatever.... adds a line break after each 'clip' is added.

My example was too easy... I will be copying several bits, of random data, from random locations... block select won't help me here...


Is there a way I can get the current clipboard selection? as a variable say?....
so that within a macro, I can grab whats already there, add a line break, then whatever text I have selected on screen?....

cheers,
Jerry

Post by Jerry »

Bonzo, you might want to get a 3rd party clipboard program like ClipCache which caches all the data copied to the clipboard. It'll do everything that you want.
User avatar
bbadmin
Site Admin
Posts: 814
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post by bbadmin »

For me, the quickest way would be to select the lines that contain what you want, paste them into a new document, then use the replace command to get rid of any excess characters.

For example, get rid of the trailing stuff by searching for the regular expression "<.+" and replacing with nothing. Leading stuff can be stripped by replacing ".+>" with nothing. Or, doing it all at once (using POSIX syntax):

Code: Select all

Find what: ^[^>]+>([^<]+).*
Replace with: \1
You could record that as a macro, if you do it a lot.

Keith MacDonald
Helios Software Solutions
Post Reply