Re: Need efficient search and replace for huge repository.....
- From: Stu <stu@xxxxxxxxxxxx>
- Date: Tue, 20 Dec 2005 03:40:20 -0500
nodiseos@xxxxxxxxx wrote:
> I have about 300 gigs of zip files within which I need to do a massive
> search and replace on two strings. The utilities I know of work great
> - if only I had a month to let them run. Anyoneknow the most efficient
> way to search and replace text within zipped up files?
>
> I need to replace this:
> 'PUBLICATION="TWR"' to 'PUBLICATION="TWH"'
> "TWR/" to "TWH/"
>
> Linux or windows will do.........
>
> Thanks!
If it's just a single file zipped up (not a series of files or a directory)
then piping them through sed would work. Something like this:
unzip -p file.zip \
| sed -e 's:PUBLICATION=\"TWR\":PUBLICATION=\"TWH\":g; s:TWR/:TWH/:g;' \
| zip | cat > new_file.zip
Stu
.
- Follow-Ups:
- Re: Need efficient search and replace for huge repository.....
- From: Joe Beanfish
- Re: Need efficient search and replace for huge repository.....
- References:
- Need efficient search and replace for huge repository.....
- From: nodiseos
- Need efficient search and replace for huge repository.....
- Prev by Date: Re: script to write to standard input ?
- Next by Date: Re: shutdown hangs
- Previous by thread: Need efficient search and replace for huge repository.....
- Next by thread: Re: Need efficient search and replace for huge repository.....
- Index(es):
Relevant Pages
|