FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 11-29-2009, 10:03 AM
Andrew Farris
 
Default Block oriented search and replace across multiple files.

On Sat, 2009-11-28 at 10:25 -0800, Ray Parrish wrote:
[snip]
> Also, I do not see any indication that Vim can do search, and replace
> across multiple files simultaneously, so I'm back to writing my program,
> which is coming along nicely.

Honestly, I use gedit for doing this sort of thing. of you just use the
'Find/Replace' tool, you can enter in text that will take up multiple
lines (or highlight the text you want replaced, then hit the
'Find/Replace' button...) I admit it's a little cumbersome for large
text blocks like you presented in your example, but I use it for small
test-replaces now and again in .csv files, and in python scripts. (Just
enter newlines as a
, and tabs as )

Hope that helps!


--
Andrew
_____________________________
Registered Linux User: 473690
Registered Ubuntu User: 22747


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-29-2009, 04:57 PM
Hal Burgiss
 
Default Block oriented search and replace across multiple files.

On Sat, Nov 28, 2009 at 10:25:54AM -0800, Ray Parrish wrote:
> Also, I do not see any indication that Vim can do search, and replace
> across multiple files simultaneously, so I'm back to writing my program,
> which is coming along nicely.

See 'bufdo', 'tabdo', 'windo' commands to operate on multiple opened files.
Depending on where you have the files open (multiple buffers, tabs or
windows).

:tabdo %s/test/x
x
x
x/ge | update

--
Hal

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-29-2009, 08:18 PM
Hal Burgiss
 
Default Block oriented search and replace across multiple files.

On Sun, Nov 29, 2009 at 12:57:53PM -0500, Hal Burgiss wrote:
> On Sat, Nov 28, 2009 at 10:25:54AM -0800, Ray Parrish wrote:
> > Also, I do not see any indication that Vim can do search, and replace
> > across multiple files simultaneously, so I'm back to writing my program,
> > which is coming along nicely.
>
> See 'bufdo', 'tabdo', 'windo' commands to operate on multiple opened files.
> Depending on where you have the files open (multiple buffers, tabs or
> windows).
>
> :tabdo %s/test/x
x
x
x/ge | update

Just to clarify a little, AFAIK you have to open the files you want to operate
on, so something like 'vim *html', would open all html's in the current
directory, and each is in its own 'buffer'. You'll just see one at a time, but
the others are all there and you can move between them, or run commands
against them. So you can use 'bufdo' command to make whatever commands global
against all buffers. tabdo is similar for tabs, so if you open the same files
as 'gvim -p *html' each html is in its own tab now.

--
Hal

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-29-2009, 08:33 PM
Ray Parrish
 
Default Block oriented search and replace across multiple files.

Andrew Farris wrote:
> On Sat, 2009-11-28 at 10:25 -0800, Ray Parrish wrote:
> [snip]
>
>> Also, I do not see any indication that Vim can do search, and replace
>> across multiple files simultaneously, so I'm back to writing my program,
>> which is coming along nicely.
>>
>
> Honestly, I use gedit for doing this sort of thing. of you just use the
> 'Find/Replace' tool, you can enter in text that will take up multiple
> lines (or highlight the text you want replaced, then hit the
> 'Find/Replace' button...) I admit it's a little cumbersome for large
> text blocks like you presented in your example, but I use it for small
> test-replaces now and again in .csv files, and in python scripts. (Just
> enter newlines as a
, and tabs as )
>
> Hope that helps!
>
I use Gedit for all of my coding work, and it does not do multi-document
search and replace. I'll try a small multi line search, and replace with
it to see how it does in that respect. It's a moot point anyway, as I
have finished all but the polishing work on my new Mullti-Document,
Block Oriented Search and Replace program.

With it I was able to change the order of my style sheet calls on every
page on my web site all at one go. The script takes five, or six minutes
to handle a large search, and replace across 70 or so files at once, but
what can I expect from bash anyway??? 8-) It's a lot faster than the
several hours it took me to do it by hand before.

My program is GUI enabled thanks to Xdialog, and I will be releasing it
as open source software on Ray's Links here in the next few days. it
accepts large blocks of text as search, and replace terms very easily.

Later, Ray Parrish

--
The Future of Technology.
http://www.rayslinks.com/The%20Future%20of%20Technology.html
Ray's Links, a variety of links to usefull things, and articles by Ray.
http://www.rayslinks.com
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.
http://www.writingsoftheschizophrenic.com



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-29-2009, 09:38 PM
R Kimber
 
Default Block oriented search and replace across multiple files.

On Sun, 29 Nov 2009 12:57:53 -0500
Hal Burgiss wrote:

> On Sat, Nov 28, 2009 at 10:25:54AM -0800, Ray Parrish wrote:
> > Also, I do not see any indication that Vim can do search, and replace
> > across multiple files simultaneously, so I'm back to writing my
> > program, which is coming along nicely.

I've missed the start of this thread, but Bluefish will search and replace
across multiple files. It's why I use it.

- Richard.
--
Richard Kimber
Political Science Resources
http://www.PoliticsResources.net/

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 07:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org