Page 1 of 1

Turma2 - Gtk2 search & replace tool

Posted: Fri 13 May 2011, 05:16
by muggins
https://launchpad.net/turma2

Image
Utility for searching for and, optionally, replacing strings in both text and binary files. This is a fork of original turma project located at: http://turma.sourceforge.net/software/turma/index.html This fork was made after decision to remove obsolete GTK1 libraries from the AUSTRUMI linux distribution. Seems like original project authors is not supporting it anymore.
Run via Menu>Filesystem>Turma2

Posted: Sat 14 May 2011, 04:35
by Geoffrey
I get this error

Code: Select all

# turma2
turma2: symbol lookup error: turma2: undefined symbol: gtk_info_bar_new
tried it on quirky 1.2.0 nop

Geoffrey

Posted: Sat 14 May 2011, 04:44
by technosaurus
Wow, extremely simple ...I may just add a frontend to my one-liner that I use for the same purpose .... I didn't realize there was a need. Brb.

Posted: Sat 14 May 2011, 08:56
by amigo
You can get the original GTK1 version here:
http://distro.ibiblio.org/pub/linux/dis ... turma-0.1/

Posted: Sat 14 May 2011, 12:46
by muggins
Hello Geoffrey,

yes, it probably needs newer gtk2 version. I was unable to get it to compile with either p412 or p431. Or, if you install these:

glib12-1.2.10.pet (53k)
gtk+12-1.2.10.pet (522k)

then the gtk1 version of turma, that amigo mentions, should work. A .pet of the gtk1 version is here: turma.

Posted: Sun 15 May 2011, 17:30
by seaside
muggins,

Thanks, this has a nice interface (much better than the original). I tried it in lupu510 and it worked except for the right-click on found items did not go to the folder.

technosaurus
Wow, extremely simple ...I may just add a frontend to my one-liner that I use for the same purpose .... I didn't realize there was a need
That must be a real long one-liner :)

Regards,
s

Posted: Mon 16 May 2011, 14:17
by technosaurus
seaside wrote:That must be a real long one-liner :)
not realy, here is a simplified version in script form

Code: Select all

#!/bin/sh
find . -iname \*$3 -exec sed -i "s/"$1"/"$2"/g" {} ';' -print
$1 is what you want to replace
$2 is what you want to replace it with
$3 is the ending of a file (ex. akefile to get Makefile and makefile or .txt to only do text files)

if this is all you want to do, then find is not necessary (i just use simple shell commands to recurse all subdirectories) , but this way maybe someone can add it as an option to pfind if they'd like (which uses various other find parameters)

Posted: Mon 16 May 2011, 22:15
by seaside
technosaurus wrote: find . -iname \*$3 -exec sed -i "s/"$1"/"$2"/g" {} ';' -print[/code]
technosaurus,

Thanks that looks quite handy - I think I'll just make that a function and slip it into my .bashrc file.

My comfort level would be much higher with a typical "editor type" search and replace function across files. Enter a file pattern, find word, and replace word; then be presented with a window of grep-like line finds -
FILENAME *line-context...found-word....*
Here, you could individually-or multi-select lines and then do a "Replace ok, Skip, or Replace All".

Regards,
s

Posted: Tue 17 May 2011, 01:38
by technosaurus
That's pretty doable, just store the find results for the filenames separately, then use grep in a loop with sed to get the line numbers and replace (i don't know if busybox sed can be limited to a specific line though ... in case someone is using a pupngo puplet)

Posted: Wed 18 May 2011, 00:32
by seaside
Here's a limited protype that just needs a front end.

Code: Select all

#!/bin/sh

DIR=/etc
SEARCH=copyright
REPLACE=Copyright

#################

grep -R $SEARCH $DIR >/tmp/finds

while read -r line
    do
    Xdialog --center --title "Mutiple file search and replace"  --ok-label "Replace" --cancel-label "Skip" --combobox "Replace $SEARCH with $REPLACE"  800x100 "$line" 
    RETVAL=$?
    if [ $RETVAL -eq 0 ]; then
		FN=`echo $line | cut -d: -f1 `
		sed -i "s/$SEARCH/$REPLACE/g" "$FN"
    fi
        
    if [ $RETVAL -eq 255 ]; then
		exit
    fi
done < /tmp/finds
 
This is probably better in Gtkdialog- at least you get more buttons there. :)

Cheers,
s

Turma does the job (Lucid Diamonds)

Posted: Sun 16 Nov 2014, 04:37
by Pelo
Turma does the job (Lucid Diamonds)

Turma as it is is useful

Posted: Tue 01 Dec 2015, 09:20
by Pelo
Moi Turma me va. Turma as it is is useful
.avi list all my videos, even more files.