Extract information for the file which is in csv with one column by comparing with another matrix file with dim of 15251*15251.

Screenshots are not very helpful, can you provide a proper reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one: