0

I have a textfile with the following strings with a comma in them:

John,Smith
Jane,Doe

How can I grep * using this textfile? I've tried to use grep -xFf textfile * but I don't get any results even if there are files that contain these strings.

a sample datafile within * contains this line: 1231920383939,'unix:///run/John,Smith','{}'

input: grep -xFf textfile *

output: (blank)

2
  • The data files contain text in this format: 1539198827392,'John,Smith','{}' if I use grep -xFf samplefile * I can't get that line for some reason Commented Oct 30, 2018 at 23:57
  • I think I can use grep -wFf textfile * instead, running some tests now Commented Oct 31, 2018 at 0:07

1 Answer 1

1

Your problem appears to boil down to the erroneous inclusion of the -x option to grep, which requires that the matched text be the only text on the line. Remove the x flag and you'll get the results you're looking for.

1
  • 1
    Thanks Jeff. For some reason I couldn't get any output at first even when not using the -x option. The grep works now without the -x flag Commented Oct 31, 2018 at 0:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.