I have a couple of files that I need to update. I have to replace a token.

Search and replace is not realy an option here. The easiest way would be if I had an editor that can open a couple of files. If I would change the text in one of the files the changes would happen in all the opened files. Does such an editor exist?

link|improve this question
I think this quesion is better suited for superuser. – Khaled Jan 24 '11 at 13:37
Why is "search and replace" not an option? As a sysadmin, (which you should be, if you're asking questions on this site), you'll want to get familiar with how to script such operations, often using tools like sed or Perl. – mfinni Jan 24 '11 at 14:21
feedback

migrated from serverfault.com Jan 25 '11 at 4:37

This question came from our site for system administrators and desktop support professionals.

2 Answers

Yes... such an editor does exist try Notepad ++ ( http://notepad-plus-plus.org )

I use this for scripting and it allows multiple files to be opened and edited simultaniously - it works much like IE8 with opened tabs

Try it anyway

It'd give it 10/10

link|improve this answer
I can open a couple of files in it. But how can you edit them in one step? You still have to repeat the editing work dont't you? – Anonymous Jan 24 '11 at 17:05
Hit Ctl-H to see the search-and-replace dialog, and you'll see a button to 'replace all', and another button to 'replace all in open documents.' – mfinni Jan 24 '11 at 17:34
feedback

sed will do any sort of replacement you like in any files you like.

sed -i "s/foo/bar/g" baz.c
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.