Splitting data table up based on separate file of gene names
There are plenty of efficient and smarter solutions, but if you have so small tables, you can just use the very basics of R to do what you need:
# you need to adjust the following two lines to fit to your file formating and file names
genes_filt_table &lt;- read.table(..., col.names = c('geneid'), stringsAsFactors = F)
norm_counts &lt;- read.table(..., col.names = c('geneid', 'norm_counts'), sep = ',', stringsAsFactors = F)

genes_to_filt &lt;- norm_counts$geneid %in% genes_filt_table$geneid
filt_genes &lt;- norm_counts[genes_to_filt, ]
non_filt_genes &lt;- norm_counts[!genes_to_filt, ]

write.table(filt_genes, 'filtered_genes.csv', quote = F, row.names = F, sep = ',')
write.table(non_filt_genes, 'non-filtered_genes.csv', quote = F, row.names = F, sep = ',')

This being said, there are like milions of more efficient solutions out there. I provided one that is using as basic R functions as possible, as it seemed that you would like to see a simple R solution.