0

Completely dumbfounded with this, using -

grep -f list.txt c:/texts/*.txt > output

list.txt contains a list of strings to grep

C:/texts/*.txt contains a bunch of text files to search

for some strong reason it keeps outputting false matches, or the entire file regardless of match I'm not sure, but example

list.txt contains >

user1@hotmail.com

C:/text/ contains

firstsearch.txt contains >

usernoname@hotmail.com:phonenumber:location

and it will output that as a match :S.. makes no sense, or I'm just missing the obvious, i don't know?

jake reading
  • 79
  • 1
  • 1
  • 5
  • Make sure that there are no empty lines in the `list.txt` pattern file. An empty line in the pattern file will match every line in the searched files. – ottomeister Jan 06 '18 at 05:58
  • @ottomeister thanks didn't realise empty lines would produce entire searched file, you've saved a lot of stress! :D – jake reading Jan 06 '18 at 17:30
  • Possible duplicate of [grep -Ff producing invalid output](https://stackoverflow.com/questions/48132274/grep-ff-producing-invalid-output) – tripleee Jan 07 '18 at 20:24

0 Answers0