Skip to content

Instantly share code, notes, and snippets.

@drldcsta
Created August 26, 2014 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drldcsta/9f3fcbefe8ddb8a4ccd9 to your computer and use it in GitHub Desktop.
Save drldcsta/9f3fcbefe8ddb8a4ccd9 to your computer and use it in GitHub Desktop.
Simple script to take a list of values from one file and search for it in another
BEGIN {
SUBSEP=" "
FS=","
while (getline < FILE )
{
desired_ids[$0]++
}
}
{
if ($3 in desired_ids) {
results[$2,$3]++
}
}
END {
for (i in results){
print i
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment