I have a directory (on my Mac) of 400,000 files and I have derived a list of 14,000 files that I would like to delete from that directory. The names of the files that need to be deleted match exactly the names in the "Files" directory, which all happen to be .txt. I have searched everywhere for a way to do this with no success.
-- Folder on Mac called "Letters" containing .txt files called, for example --
Letter_1925_1_1_1.txt
Letter_1937_15_5_3.txt
Letter_1950_99_8_2.txt
Letter_1951_7_18_1.txt
Letter_1968_64_19_1.txt
Letter_1983_88_4_2.txt
Letter_1990_12_22_4.txt
Letter_1995_90_10_2.txt
-- A CSV and/or TXT file with names that need to be deleted --
Letter_1925_1_1_1.txt
Letter_1968_64_19_1.txt
Letter_1990_12_22_4.txt
Letter_1995_90_10_2.txt
-- After running some sort of process, I would like the directory to only contain the following files --
Letter_1937_15_5_3.txt
Letter_1950_99_8_2.txt
Letter_1951_7_18_1.txt
Letter_1983_88_4_2.txt
As I am learning to be more technical, I would prefer to find this solution either in Mac Terminal or in R. Thanks everyone!