How to grep for line-separated strings containing a comma in a text file?

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












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)










share|improve this question



















  • 1




    Can't reproduce here; when I create a sample text file and sample input files, grep -xFf samplefile *, I get back all the files I'm expecting. Do the data files contain one of those textfile strings on their own line? (That's what -x requires)
    – Jeff Schaller
    12 mins ago










  • 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
    – kouichi
    8 mins ago











  • Edit the sample input and output into your question-- comments are inadequate.
    – Jeff Schaller
    6 mins ago














up vote
0
down vote

favorite












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)










share|improve this question



















  • 1




    Can't reproduce here; when I create a sample text file and sample input files, grep -xFf samplefile *, I get back all the files I'm expecting. Do the data files contain one of those textfile strings on their own line? (That's what -x requires)
    – Jeff Schaller
    12 mins ago










  • 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
    – kouichi
    8 mins ago











  • Edit the sample input and output into your question-- comments are inadequate.
    – Jeff Schaller
    6 mins ago












up vote
0
down vote

favorite









up vote
0
down vote

favorite











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)










share|improve this question















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)







grep






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 mins ago

























asked 20 mins ago









kouichi

315




315







  • 1




    Can't reproduce here; when I create a sample text file and sample input files, grep -xFf samplefile *, I get back all the files I'm expecting. Do the data files contain one of those textfile strings on their own line? (That's what -x requires)
    – Jeff Schaller
    12 mins ago










  • 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
    – kouichi
    8 mins ago











  • Edit the sample input and output into your question-- comments are inadequate.
    – Jeff Schaller
    6 mins ago












  • 1




    Can't reproduce here; when I create a sample text file and sample input files, grep -xFf samplefile *, I get back all the files I'm expecting. Do the data files contain one of those textfile strings on their own line? (That's what -x requires)
    – Jeff Schaller
    12 mins ago










  • 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
    – kouichi
    8 mins ago











  • Edit the sample input and output into your question-- comments are inadequate.
    – Jeff Schaller
    6 mins ago







1




1




Can't reproduce here; when I create a sample text file and sample input files, grep -xFf samplefile *, I get back all the files I'm expecting. Do the data files contain one of those textfile strings on their own line? (That's what -x requires)
– Jeff Schaller
12 mins ago




Can't reproduce here; when I create a sample text file and sample input files, grep -xFf samplefile *, I get back all the files I'm expecting. Do the data files contain one of those textfile strings on their own line? (That's what -x requires)
– Jeff Schaller
12 mins ago












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
– kouichi
8 mins ago





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
– kouichi
8 mins ago













Edit the sample input and output into your question-- comments are inadequate.
– Jeff Schaller
6 mins ago




Edit the sample input and output into your question-- comments are inadequate.
– Jeff Schaller
6 mins ago















active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "",
contentPolicyHtml: "",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478775%2fhow-to-grep-for-line-separated-strings-containing-a-comma-in-a-text-file%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478775%2fhow-to-grep-for-line-separated-strings-containing-a-comma-in-a-text-file%23new-answer', 'question_page');

);

Post as a guest













































































zXTz,Emq5G FkU,pNBh4v56RvQ rdaee3Gg,jKIPUzE 19WWuox8X2uTvSsxmDMhwjizP8jOohF Ut6x70 m1oAz
LPmISE9HTycrsurlu49ifhRIT9qm yJj7p,uNwz,Pqoj8r 5PlQXLJukOl8C4sGl3eMERjwpdp5VdBo76fintse,oCyp

Popular posts from this blog

How to check contact read email or not when send email to Individual?

How many registers does an x86_64 CPU actually have?

Displaying single band from multi-band raster using QGIS