Re: Need efficient search and replace for huge repository.....



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
.



Relevant Pages

  • Need efficient search and replace for huge repository.....
    ... I have about 300 gigs of zip files within which I need to do a massive ... search and replace on two strings. ... Anyoneknow the most efficient ... Prev by Date: ...
    (comp.os.linux.misc)
  • Problems with InvokeMember()
    ... The example from MSDN works fine for strings,but it's not working for ... primitives like 'double' ... Type mtype = m.GetType; ... Prev by Date: ...
    (microsoft.public.dotnet.csharp.general)
  • Re: Interfacing question
    ... include data in a gazillions forms, but fundamentally that are all bits ... a few strings, integers ... etc. that could easily be returned using a function call as var types ... Prev by Date: ...
    (microsoft.public.vb.general.discussion)
  • Re: Guitar string life
    ... I'd usually change 'em every gig. ... 2 sets of new strings every night. ... gigs, which I did occasionally, there was a fair chance I'd break one. ... long enough to go dead so tonal life-span wasn't a factor. ...
    (alt.guitar)
  • Re: And a belated happy birthday to ME!!
    ... > to get my car booked in to a bodyshop to get it fixed, ... > ignored the fact that it was my birthday. ... and 20 gigs this month. ... Prev by Date: ...
    (rec.music.makers.percussion)