[kde-linux] Counting words in Kate

Paulo J. Matos pocmatos at gmail.com
Wed Apr 12 08:04:52 UTC 2006


On 11/04/06, Andrew Walbran <qwandor at gmail.com> wrote:
> On Tue, 11 Apr 2006 9:47 pm, Paulo J. Matos wrote:
> > On 11/04/06, Paulo J. Matos <pocmatos at gmail.com> wrote:
> > > Hi all,
> > >
> > > I have a big plain file of text and I would like to count the words in
> > > a certain section of the document. Is it possible to select a region
> > > and count the words in it? It is certainly easiear than copying to a
> > > new file and counting through terminal with wc -l. Any suggestions?
> >
> > I meant wc -w, of course.
> One possibility:
>
> Go Settings->Configure Kate->Application->External tools.
> Click New..., enter 'Count selected words' for the title and the following for
> script:
>
> COUNT=$(echo "%selection" | wc -w)
> kdialog --title "Word count" --msgbox "$COUNT words are selected."
>
> Choose an icon if you like, then press OK twice.
> Now you can use Tools->External Tools->Count selected words on the menu.
>

Hi,

For some reason this is not working. I add the script but then as soon
as I leave preferences the script disappears. I'm in 3.5.2.

I only fill the title and script. Do I need anything else?
At least KDE doesn't complain but then deletes the script. :-|

Cheers,

Paulo Matos

>
> --
> Andrew Walbran
> website: http://user.interface.org.nz/~andrew/
> blog: http://qwandor.wordpress.com/
>
>
>


--
Paulo Jorge Matos - pocm at sat inesc-id pt
Web: http://sat.inesc-id.pt/~pocm
Computer and Software Engineering
INESC-ID - SAT Group



More information about the kde-linux mailing list