mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Linux (https://www.mersenneforum.org/forumdisplay.php?f=39)
-   -   Recommended GREP for windows? (https://www.mersenneforum.org/showthread.php?t=13943)

Uncwilly 2010-09-21 17:19

Recommended GREP for windows?
 
At work, my machine runs windows (can't change that). I could really benefit from the functionality of grep on a certain project (repetative find and replaces over a group of files) . I don't have admin rights on the PC. I would like to find a free grep for windows that can live outside of ProgramFiles (so that I can try it out.) If it works out ok, I can petition to have it properly installed.

Does anyone have any recommendations? I have looked at a few of the top hits on our fav search engine.

kar_bon 2010-09-21 17:52

The [url=http://unxutils.sourceforge.net/]GNU utilities for Win32[/url] cotain command line versions of egrep.exe, fgrep.exe and grep.exe. Try "grep --help" for more info.

Uncwilly 2010-09-21 20:34

Thanks for that pointer. I think that will now be on my home machine....

I found [URL="http://notepad-plus-plus.org/"]Notepad++[/URL] I have tried it and it seems to work well for one thing that I really wanted, multiline find and replace. I can highlight the text and replace all occurances in whateever file type in a directory. I parked it in a temp folder (it can live on a USB drive).

Free [COLOR="Green"]√[/COLOR]
Does not have to be in Program Files [COLOR="green"]√[/COLOR]
Does not nee to write to registry [COLOR="green"]√[/COLOR]
Multiline find and replace [COLOR="green"]√√[/COLOR]
Multifile actions [COLOR="green"]√[/COLOR]
Commandline driven [COLOR="Red"]Χ[/COLOR]

Overall a big win. :tu:

cmd 2010-09-21 23:23

Will, you kindly help us with "regular expressions"
(search and replace) ?

search .
Replace &\t

start
01f
result
0\t1\tf



( \t = tab )

( & | $ ) [COLOR="Magenta"]not working properly[/COLOR]

(Thanks)

jasonp 2010-09-22 02:12

You an also install MinGW and Msys, which will give you a complete unix environment without touching the registry. If you put the path to the MinGW and Msys binaries in your environment then you can also use a large number of common text utilities from the windows command prompt.

By the way, to do an automated search and replace over multiple files I find 'sed' is more useful.

Chris Card 2010-09-22 08:03

I take it people have a downer on Cygwin for some reason? (perhaps because it writes to the registry?).

Chris

xilman 2010-09-22 08:26

[QUOTE=Chris Card;230855]I take it people have a downer on Cygwin for some reason? (perhaps because it writes to the registry?).

Chris[/QUOTE]I have a downer on it because it is GPL licensed. To be able to redistribute binaries their sources must also be redistributed under the GPL. If the source is Free but not GPL (BSD for instance) you can't send anyone a binary.


Paul

Chris Card 2010-09-22 10:34

[QUOTE=xilman;230856]I have a downer on it because it is GPL licensed. To be able to redistribute binaries their sources must also be redistributed under the GPL. If the source is Free but not GPL (BSD for instance) you can't send anyone a binary.


Paul[/QUOTE]
I understand, but the original question was about grep.

Chris

jasonp 2010-09-22 12:41

Cygwin reproduces a posix environment much more faithfully than MinGW does, which means its various pieces are integrated together much more tightly than I'd like. At least twice now, I've had to install new versions of packages I've needed, but if the cygwin install is more than a year old then nothing will work unless I throw it all away and get the latest version of [i]everything[/i]. Not that something basic like grep would have that problem, but it's a pain to need version of X+1 of something and then put everything on hold while cygwin reinstalls.

Another problem I've noticed is that installing packages in cygwin requires the ability to run cygwin install scripts, which means you have to use their setup utility to run everything and track down dependencies. With MinGW you just unzip the new package into your current install. Using the setup utility means needing network access for it to get all the packages it needs; that sounds like a no-brainer, until you have to install cygwin on a machine with no or restricted network access. What can you do then, put a whole cygwin mirror on a DVD?

Chris Card 2010-09-22 14:45

[QUOTE=jasonp;230876]Cygwin reproduces a posix environment much more faithfully than MinGW does, which means its various pieces are integrated together much more tightly than I'd like. At least twice now, I've had to install new versions of packages I've needed, but if the cygwin install is more than a year old then nothing will work unless I throw it all away and get the latest version of [i]everything[/i]. Not that something basic like grep would have that problem, but it's a pain to need version of X+1 of something and then put everything on hold while cygwin reinstalls.

Another problem I've noticed is that installing packages in cygwin requires the ability to run cygwin install scripts, which means you have to use their setup utility to run everything and track down dependencies. With MinGW you just unzip the new package into your current install. Using the setup utility means needing network access for it to get all the packages it needs; that sounds like a no-brainer, until you have to install cygwin on a machine with no or restricted network access. What can you do then, put a whole cygwin mirror on a DVD?[/QUOTE]
On the other hand, I've found it much easier to set up a development environment with Cygwin (though to be honest I now tend to run Fedora as a VirtualBox guest). I don't remember having to reinstall everything, though the cygwin dlls do change from time-to-time.

Chris

Uncwilly 2010-09-22 15:03

[QUOTE=Chris Card;230855]I take it people have a downer on Cygwin for some reason? (perhaps because it writes to the registry?).[/QUOTE]
:direction:

But that is ok. The original need has been filled.


All times are UTC. The time now is 08:05.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.