Unicode grep for Windows

13

0

Is there a Unicode-aware grep for Windows 32-bit?

Jeroen Wiert Pluimers

Posted 2010-02-09T12:57:47.997

Reputation: 2 373

Question was closed 2015-05-11T18:04:40.180

1Did you find one that worked with Unicode? It is not at all clear in the answers if the different tools are Unicode-aware or not. – Peter Mortensen – 2012-05-22T09:26:11.153

1I gave up and used the built-in search of Visual Studio (: – Jeroen Wiert Pluimers – 2012-05-22T11:39:11.130

Answers

8

For a command line tool, look at KeyboardMonkey answer (but I'm not sure about Unicode support).

For an (open source) GUI tool: dnGREP

  • Shell integration (ability to search from Windows Explorer)
  • Plain text, regular expression, and XPath search (including case-insensitive search)
  • Phonetic search (using Bitap and Needleman-Wunch algorithms)
  • File move/copy/delete actions
  • Search inside archives / MS Word documents / PDF documents (via plug-ins)
  • Undo functionality
  • Optional integration with text editor (like Notepad++)
  • Bookmarks (ability to save regular expression searches for the future)
  • Pattern test form
  • Search result highlighting
  • Does not require installation (can be run from a USB drive)

enter image description here

For a more simple (only search) GUI tool: AstroGrep and for a more featured (and expensive) one: PowerGREP

fluxtendu

Posted 2010-02-09T12:57:47.997

Reputation: 6 701

According to gizmo's freeware, "Replace Text" http://www.ecobyte.com/replacetext/ is another interesting option

– fluxtendu – 2010-02-09T18:13:54.430

Sorry for the necro, but THANK YOU!! I desperately this tool in Windows, and this dnGREP is a godsend! – pepoluan – 2017-03-26T16:01:10.820

3

Most versions of Windows include the command "findstr" which works much like grep. I do not know about its Unicode abilities, but to my knowledge there shouldn't be any problems with that.

Morfildur

Posted 2010-02-09T12:57:47.997

Reputation: 795

2

Update: GnuWin32 is a more recently maintained port of these tools. (Thanks Quack)

Here is a list of the packages and to download grep individually.

Have a look at UnxUtils, which includes grep as well. I use these on my work PC, too.

invert

Posted 2010-02-09T12:57:47.997

Reputation: 4 918

3

UnxUtils is old and unsupported -- last updated in 2003. try GnuWin32 for a more recent toolset: http://gnuwin32.sourceforge.net/

– quack quixote – 2010-02-09T18:16:29.540

1

Yes, as fluxtendu mentions,

  • PowerGREP will do all that. But it is proprietary and costs 149 Euros.
  • dnGREP will work too, and has a similar feature set for free.

However,

  • Cygwin can also install grep (and a whole lot more if you want.) It will do Unicode search with the -U switch. I would recommend Cygwin as the simplest solution if you're familiar with Unix grep. Just make sure to append your PATH and you can use it in the Windows shell too.

brice

Posted 2010-02-09T12:57:47.997

Reputation: 2 206

1

I asked this question a while back and finally discovered grepWin which is a GUI via the shell context menu. Works quite well.

jacobsee

Posted 2010-02-09T12:57:47.997

Reputation: 861

1

The simplest way to do this there is a Windows utility called "strings" which does exactly what you're after:

Strings (Sysinternals)

Basically, it pulls all the Unicode characters out of files, so you can then pipe it to whatever Windows grepalike you use, be it findstr (native) or like me, gnuwin32 grep for Windows (does what it says on the tin).

So you get something like:

strings *.odf | grep -i  "texttosearch"

findstr works too for a lot of things but grep is just all around better.

Some_Guy

Posted 2010-02-09T12:57:47.997

Reputation: 684

1How, exactly, does this answer the question?  The strings program is used for finding text strings that are mixed in with non-text (“binary”) data; e.g., executable files.  The question doesn’t say anything about having text strings embedded in binary data.  … … … … … … … …  What if I want to search a Unicode text file for characters like π and ?  Would I type strings dissertation | findstr "π"?  Doesfindstr handle Unicode?  If it does, then why not just say findstr "π" dissertation, which was suggested five years ago?  If it doesn’t, then what have you gained? – G-Man Says 'Reinstate Monica' – 2015-05-09T22:57:56.010

good point. I suppose I didn't properly grasp what the questioner was after – Some_Guy – 2015-05-09T23:14:53.347

0

See BareGrep (free version has a startup splash screen), which seems to be a quite complete graphical grep. The documentation mentions support for "Many file formats", so I would imagine that Unicode is included.

enter image description here

harrymc

Posted 2010-02-09T12:57:47.997

Reputation: 306 093

I'm pretty sure it does NOT support Unicode. I tried it and it doesn't work on UTF-16 files. Have emailed them to confirm. – O'Rooney – 2013-09-02T00:55:41.060