EDIT: My problems have been solved thanks to the help of bartus11 and pravin27
This code is just to help me learn. It serves no purpose other than that.
Here's a sample csv that I'm working with -
#listofpeeps.csv
Jackie Chan,1954,M
Chuck Norris,1930,M
Bruce Lee,1940,M
This code is used to extract strings from the above csv and output the strings meeting my specification of DOB == 1940 into another file titled 1940births.csv
awk -F, '{ if ($2 == 1940) print $1 "," $3}' listofpeeps.csv > 1940births.csv
This program will output:
#1940births.csv
Bruce Lee,M
Let's say I have another .csv file that has -
#ethnicity.csv
1,Bruce Lee,Chinese
2,Chuck Norris,Irish
3,Jackie Chan,Chinese
How would I go about comparing the "Bruce Lee" or first column in the 1940births.csv with the "Bruce Lee" or second column in the ethnicity.csv file?