Milan Babuškov
Milan Babuškov

Reputation: 61228

Replace in multiple files - graphical tool for Linux

It needs to be graphical. No sed, awk, grep, perl, whatever. I know how to use those and I do use them now, but I need to cherry-pick each replace in 300+ files.

I want a tool where I can:

and it would recursively go into each file in that directory and its sub-directories, open it and scroll to the place where search string is and offer two options:

Nothing more. Reg.exp. support is a plus, but not required.

SOLVED: Regexxer is exactly what I needed. In case someone needs it on Slackware, here's what you need to download and how to compile it (choosing correct version of each dependency can be a PITA)

Upvotes: 26

Views: 11674

Answers (7)

Francewhoa
Francewhoa

Reputation: 81

jdReplace

Can handle very large amount of files. Easy to use, fast, and its repository is with the strong privacy and strong security Codeberg.

Upvotes: 1

ADEpt
ADEpt

Reputation: 5552

Emacs + dired + query-replace-regexp

For complete recipe follow this link (it's rather long, covering all possible alternatives),

Upvotes: 8

Jay
Jay

Reputation: 42722

I think regexxer is exactly what you're looking for:

Regexxer

regexxer is a nifty GUI search/replace tool featuring Perl-style regular expressions. If you need project-wide substitution and you’re tired of hacking sed command lines together, then you should definitely give it a try.

See also the screenshot, looks a lot like what you're describing:

screenshot

Upvotes: 30

Ahmed Rashed
Ahmed Rashed

Reputation: 91

Lately Kate (if you use KDE) can do it, but in a very tricky way. Go to "Edit>Search in Files", and choose the folder within which your files exist.

The trick is that only after the search results appear, you will find a text box and a button called "Replace checked". This button will do what you want.

Upvotes: 6

Flavio
Flavio

Reputation: 71

If you are a KDE user there's also kfilereplace.

Upvotes: 2

rmeador
rmeador

Reputation: 25724

I use gVim for this task all the time. I open up all the files at once, then use the commands to perform a subsitution on each file, asking for confirmation. Generally I use < 20 files, so I open them as tabs and use this:

:tabdo %s/foo/bar/gc

gVim works fine on Windows :) My coworkers often use Textpad to do this same thing, but I'd say gVim is much more efficient at it.

Upvotes: 3

Neall
Neall

Reputation: 27164

jEdit does exactly what you need. It is written in Java and works well in Linux, Windows and OS X (probably other operating systems also).

Upvotes: 7

Related Questions