Turma2 - Gtk2 search & replace tool

Filemanagers, partitioning tools, etc.
Post Reply
Message
Author
muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

Turma2 - Gtk2 search & replace tool

#1 Post 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
Attachments
turma2-0.3.1.pet
(41.81 KiB) Downloaded 832 times

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#2 Post 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

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#3 Post 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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#4 Post by amigo »

You can get the original GTK1 version here:
http://distro.ibiblio.org/pub/linux/dis ... turma-0.1/

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#5 Post 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.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#6 Post 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

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post 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)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#8 Post 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

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#9 Post 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)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#10 Post 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

Pelo

Turma does the job (Lucid Diamonds)

#11 Post by Pelo »

Turma does the job (Lucid Diamonds)

Pelo

Turma as it is is useful

#12 Post by Pelo »

Moi Turma me va. Turma as it is is useful
.avi list all my videos, even more files.

Post Reply