Hi all :)
I got a text file with LOTS of names. I want a list of all the strings(lines) that is either 1) Different in CASE (i.e audi vs AuDI) 2) Different by more than 1 character ie (mygoo VS my-goo) Any ideas ??
Hi all :)
I got a text file with LOTS of names. I want a list of all the strings(lines) that is either 1) Different in CASE (i.e audi vs AuDI) 2) Different by more than 1 character ie (mygoo VS my-goo) Any ideas ??
you really mean more than 1 character difference? it would match all words, wouldn't?
if you mean at most X difference(s), you can use agrep fuzzy search.
e.g. for following /tmp/list
bar
foobar
fooBar
foo-bar
foo--bar
spam
toolbar
command
$ agrep -1 foobar /tmp/list
will find:
foobar
fooBar
foo-bar
(it includes the original pattern, which you can filter out, e.g. appending | grep -v '^foobar$'
)
this is a hint about a tool, which you can use, it might not be exactly what you wanted. please look at -i
agrep option as well