RKG Duck: A Windows Clipboard Filter

Download

Download RKG Duck: http://www.rimmkaufman.com/content/rkg-duck.zip

Overview

RKG Duck is a free tool which applies a Perl filter to the Windows clipboard.

Because the clipboard works within and between nearly every Windows application, RKG Duck lets you transform data within Excel, Powerpoint, Word, Notepad, etc. with ease.

Because RKG Duck uses Perl for its filtering code, you have the rich power of Perl regular expressions, the extraordinary depth of pluggable Perl modules (CPAN), and the ability to use the same filters as is on the Windows or Linux command line.

rkg duck, a windows clipboard filter

You can watch a demo 1 or demo 2 on YouTube. We made a a super-fast overview demo video, too.

Use

We’ve found RKG Duck helpful manipulating data for paid search campaigns, but the tool can be used in many other areas.

You can use the program to expand shortcut acronyms (ala Texter), analyze text for reading level or awkward constructions, extract query strings from Apache logs, encrypt or decrypt text — just about anything.

Plugins

To add plugins, place additional Perl scripts in the program’s directory. Name these files with the prefix “filer_”, as in “filter_foo.pl”, “filter_bar.pl”, etc.

Here’s the basic template for a plugin filter:

# foo->bar demo filter


# input from STDIN, output to STDOUT

 

use strict;


while (<STDIN>)


{


    s/foo/bar/g; # do some sort of transform


    print; # send the result to STDOUT.


}


# RKGDUCK


# documentation at www.rimmkaufman.com/duck

If you want to use a filter to modify a column in Excel in situ, make sure the filter outputs the same number of rows as it reads.

If you wish to use CPAN modules, place them in same directory as the filters, and be sure to “use” them in your filter.

Technology

RKG Duck is a small Perl TK script bundled with PAR.
The bundling isn’t particularly efficient, as it rolls in the Perl binaries and all required modules. This is why the executable is so large. PAR is finicky, and the resulting bundle might not work on all Windows installs.

Command Line

Because RKG Duck filters are well-formed Perl scripts, you can use them from the Windows or Linux command line on files as well. A well-installed Linux distro will have Perl available by default. On Windows, you can download free Perl binaries from ActiveState.

License

RKG Duck
is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details: http://www.gnu.org/licenses/.

Video Demos

Video 0: Short Preview Video

Video 1: Introduction

Video 2: How To Write A Filter & Stemming For AdGrouping

Video 3: Save Time On Your PPC Projects Using RKGDuck

Related Links

FAQS

Do I need to install Perl on machine to use RKGDuck? I’d like to share this program with several colleagues, but don’t want to hassle with ActiveState and the plugins on each machine.

No, RKGDuck should run as-is, without a Perl install.

I got Duck working, but it can’t find any filters, either the ones you provided or the new one I just wrote. The leftside filter menu is totally blank. Help!

The RKGDuck executable (rkg-duck.exe) must be in same folder as the filters. Also, you must run the Duck from that folder directly, not via a Windows shortcut. Your best bet is to place the entire RKGDuck folder on a fileshare (if you want several folks to share filters) or in C:/Program Files. Then, instead of making a Windows shortcut link to the executable on your desktop or in the start menu, make the shortcut go the RKG Duck folder itself, so clicking on the link opens the folder, and then the user can start the program by clicking the executable.

Sometimes, particularly on older Windows machines, the first time I run RKG Duck each day, it is slow to start. Really slow, long wait. But it then runs fast, and starts fast on subsequent runs.

Yes.

I want to use preexisting CPAN modules for some heavy lifting, like validating XML, recognizing and removing profanity, doing LDAP lookups, word stemming, and so forth. I am having trouble.

RKG Duck looks for modules relative to its own directory, not along the traditional perl path. This makes distributing filters to users who do not have perl on their machine easier, but makes writing modules which use canned modules harder. Your best bet is to stick with pure perl modules from CPAN, and install them yourself in the Duck folder. One of the filter examples provided in the zip directory uses URI::Escape; see that for details.

Alternatively, you can set Duck’s module path using perl’s standard “use lib” functionality. Just note that this approach could hinder distribution of that filter to other computers if other folks don’t have those modules in that directory.

My filter turned red!

Your filter has an error. Run the filter from a command line to check syntax and to make the error message visible (for this, whomever is writing RKGDuck filters should have perl installed): perl -c filter_foobar.pl

RKGDuck didn’t see my filter — it isn’t showing up on the menu.

The filter must be n the same directory as the executable. The filter file name must be prefaced with “filter_”, as in “filter_somename.pl”.

I just don’t understand the point of RKGDuck at all.

No worries. If it doesn’t help, don’t use it.

Download

Download RKG Duck: http://www.rimmkaufman.com/content/rkg-duck.zip