Computing Staff
  • 0

Ignore Diacritics And Accents In Grep

  • 0

Hello, I am using gnuwin32 tools in Windows.

I need a solution to do a batch search that ignores diacritics and accents

the input text file looks like this:

english
énglish
énglish
ènglish
ĕnglish
ênglish

when i do “grep english file.txt” it only shows me the first line but I need the script to return all those lines.

if grep can’t do it, is there any better command line search tool?

Share

1 Answer

  1. grep '[eééèĕê]nglish' file.txt

    should do the job.

    As mikelinus says, they are different characters so there’s no easy way to just drop the accents (other than specifying each character).

    • 0