I have 2 big .csv file. I want to extract content of file 2 that there in file 1.
for example:
file1:
A1BG 1
NAT1 9
NAT2 10
SERPINA3 12
AAMP 14
AANAT 15
AARS1 16
file 2:
1 10422
1 10549
1 2232
1 23198
1 23352
1 284403
1 368
1 51035
1 80854
1 9923
2 10053
2 10376
2 10724
2 2026
2 2193
2 22976
2 23154
2 24138
2 2639
2 284207
2 285203
2 3337
2 3437
2 348
2 348
2 348
2 351
4 7689
output:
1 10422
1 10549
1 2232
1 23198
1 23352
1 284403
1 368
1 51035
1 80854
1 9923
it is my code:
awk 'NR==FNR{FS=" ";a[$2];next}{FS=" ";if ($1 in a) print $0}' <file1.csv <file2.csv >output.csv
but I have no output.