Walt Mankowski on 17 Jun 2016 13:13:19 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] find all files with non ascii characters in a directory


On Fri, Jun 17, 2016 at 11:18:08AM -0400, brent timothy saner wrote:
> On 06/17/2016 11:13 AM, Michael Lazin wrote:
> > I see that I was missing the -P to indicate perl regex.  I subsquently
> > tried this:
> > 
> > find . -type f | grep -P "[\x80-\xFF]"
> > ./.PlayOnLinux/configurations/icones/Marine Malice 2 : Le Mystère de
> > l'Ecole Hantée
> > 
> > It found a french named file I didn't even know I had but ignored the
> > chinese named test file completely.  It is imperative that it also find
> > chinese characters. 
> > 
> > Any help would be appreciated.
> 
> 
> should have kept reading ;)
> 
> https://stackoverflow.com/a/3208902
> 
> assuming you have a recent enough grep version (assuming it's not some
> absolutely ancient grep), you should also be able to do:
> 
> find ./ -f -type f | grep -Pv "[[:ascii:]]"

I had to solve a similar problem with my dissertation[1]. I used

  perl -ne "print if /[^[:ascii:]]/"

which looks like it's basically the same thing.

Walt

1. http://www.mawode.com/blog/blog/2012/04/20/finding-unicode-characters-in-latex-and-bibtex/

Attachment: signature.asc
Description: PGP signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug