Created
December 14, 2023 16:51
-
-
Save clarkritchie/7c3cdc91043e7bc399b5ffc592318088 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# quick and dirty -- for each row in CSV 1, see if that field exists in CSV 2 | |
# | |
skip_headers=1 | |
while IFS="," read -r c1 c2 c2 c4 c5 c6 c7 # 'email' is field c2 | |
do | |
if ((skip_headers)) | |
then | |
echo "skipping header row" | |
((skip_headers--)) | |
else | |
echo "Checking $c2" | |
result=`egrep -i $c2 test2.csv` | |
if [ ! -z "$result" ]; then | |
echo "*** $c2 is in both files ***" | |
fi | |
fi | |
done < test1.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment