Skip to content

Instantly share code, notes, and snippets.

Last active June 30, 2021 06:46
What would you like to do?
Find all lines from one file in another file (I'm using csv)
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 3.
# Search through the contents of this file
search="{full file path}"
# Find contents from this file
pattern="{full file path}"
grep -f <(tr ',' '\n' < "${patterns}") "${search}"
# To find contents that is NOT in the search file add -v to the grep command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment