The Core

Why We Are Here => Hardware & Technology => Topic started by: Rumbas on March 21, 2017, 07:23:18 AM

Title: Search replace for Windows?
Post by: Rumbas on March 21, 2017, 07:23:18 AM
I remember RC using some nice program to do bulk search/replace in a bunch of html files without opening them etc.

I don't remember which one though? ..and doing searches yields nothing but hacked malware sites..
Title: Re: Search replace for Windows?
Post by: ukgimp on March 21, 2017, 09:11:14 AM
grep?
Title: Re: Search replace for Windows?
Post by: Adam C on March 21, 2017, 09:15:43 AM
Vague recollection of doing something similar with Textpad, Notepad++ or another package I used to use about 10 years ago whose name escapes me now, but think it was part of the Dreamweaver suite but less of a WYSIWYG and more of an HTML editor.
Title: Re: Search replace for Windows?
Post by: ukgimp on March 21, 2017, 09:51:43 AM
Yes, Dreamweaver does that. I forgot. It even gives a warning, that it cannot be undone. Very good for template changes.
Title: Re: Search replace for Windows?
Post by: Rupert on March 21, 2017, 10:00:39 AM
Dreamweaver, that brings back memories.

I dont think editplus does it.

Notepad++  does, just tried it on 3 files. did hang for a few secs so not sure what happens if you have 100 files or more.

Title: Re: Search replace for Windows?
Post by: Rooftop on March 21, 2017, 10:02:19 AM
I had a friend knock up a little utility to do this using Delphi some years back.  Took him about 15 minutes.
From memory Dreamweaver needed to index the folders as a site before it would do it (may be entirely wrong - very long time since I used it). If that isn't an option you might be able to get someone off upwork to knock something up
Title: Re: Search replace for Windows?
Post by: JasonD on March 21, 2017, 10:42:30 AM
Gimpy said grep, I'd suggest SED

Both are 'nix utilities.

This is a Powershell equivalent.

https://blogs.msdn.microsoft.com/zainnab/2007/07/08/grep-and-sed-with-powershell/
Title: Re: Search replace for Windows?
Post by: rcjordan on March 21, 2017, 11:03:00 AM
Ultraedit

<added>
I rolled back to Ver 6 because I felt UE was subject to creeping elegance.
Title: Re: Search replace for Windows?
Post by: rcjordan on March 21, 2017, 11:16:50 AM
>Ver 6

Correction: Ver 7.10a

In toolbar: Search > Replace In Files

Title: Re: Search replace for Windows?
Post by: Chunkford on March 21, 2017, 11:24:36 AM
I use this everyday, I'd be lost without it - http://astrogrep.sourceforge.net/
Title: Re: Search replace for Windows?
Post by: Chunkford on March 21, 2017, 11:27:18 AM
Quote from: Chunkford on March 21, 2017, 11:24:36 AM
I use this everyday, I'd be lost without it - http://astrogrep.sourceforge.net/

EDIT: actually, not sure it does replace, only ever used it to track down stuff
Title: Re: Search replace for Windows?
Post by: Rumbas on March 21, 2017, 12:14:34 PM
Wow, you guys are fast today! Thanks!

Torben also reminded me about UltraEdit which is the superior text editor.

Got suggested Notepad++ as well. Free. Did the job.

https://notepad-plus-plus.org/download/v7.3.3.html
http://www.ultraedit.com/
Title: Re: Search replace for Windows?
Post by: rcjordan on March 21, 2017, 12:24:24 PM
>Notepad++

Will it do regex f&r ?
Title: Re: Search replace for Windows?
Post by: Rumbas on March 21, 2017, 01:38:04 PM
Absolutely:
http://markantoniou.blogspot.dk/2008/06/notepad-how-to-use-regular-expressions.html
Title: Re: Search replace for Windows?
Post by: rcjordan on March 21, 2017, 01:51:40 PM
Good to know, thanks.  I get occasional how-do-you-do-that requests from semi-techie family members. UE is overkill, too powerful, and not free.  It's ui -at least in the old ver I use- is a little, errr, stark for those who live in the gui world. (Which is another reason why I like it V7.)

>too powerful

Hhh. ANYTHING that will do recursive regex on local files is too powerful for semi-techs ...but they'll soon learn to sit on their hands awhile and think before pushing the button.

<added>
There's no 'undo' in UE file f&r.
Title: Re: Search replace for Windows?
Post by: ergophobe on March 21, 2017, 02:45:21 PM
Notepad ++ as mentioned already

There's also grepWin, dnGRep, winGrep, Astrogrep

But if you are going to be lots of this and you want complicated processing, multi-step and all sorts of stuff like that, there is NOTHING to match PowerGREP

Yeah, it's $159 and the ones mentioned so far are all free or close to it. But for 10 (?) years, it has been my ultimate text processing toolkit. I've had processes that involved a dozen complicated and sequential regex transformations and you just load them all into PowerGREP, save the definition file and for the rest of your life you can load it and run those transformations on a text file.

I just used it recently to take a logfile with 2.4 million entries from a dozen domains and pull out the 404s for a given domain

https://www.powergrep.com/index.html



Title: Re: Search replace for Windows?
Post by: rcjordan on March 21, 2017, 04:25:18 PM
I will see your Powergrep and raise you Funduc.

https://www.funduc.com/replace_studio_pro.htm

I own it but it was overkill.

Title: Re: Search replace for Windows?
Post by: ergophobe on March 21, 2017, 05:44:15 PM
Quote from: rcjordan on March 21, 2017, 04:25:18 PM
I will see your Powergrep and raise you Funduc.

I call Funduc and raise you history, unlimited undo, "collect data", filter file list (i.e. files that are searched) with regular expressions

I haven't tried Funduc, but I've tried a lot of the competitors when I've had to work on another machine without PowerGREP, but none of them are so fine.
Title: Re: Search replace for Windows?
Post by: rcjordan on March 21, 2017, 07:50:52 PM
Fold
Title: Re: Search replace for Windows?
Post by: gm66 on March 29, 2017, 11:35:16 AM
I can knock up HTML parsers pretty quick if you can't find something that does the job you want.