Output lines from a file that match pattern 1 and not pattern 2 in linux
I have a txt file that has a bunch of lines. I used grep to print lines matching pattern 1 to a second file. I want to modify the command to exclude the lines the match pattern 2. So the requirement is
if (match pattern 1) && (! match pattern 2 )
print to csv