[kde-linux] Counting words in Kate

Andrew Walbran qwandor at gmail.com
Tue Apr 11 10:05:52 UTC 2006


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.


-- 
Andrew Walbran
website: http://user.interface.org.nz/~andrew/
blog: http://qwandor.wordpress.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-linux/attachments/20060411/316c587b/attachment.sig>


More information about the kde-linux mailing list