I'm well aware of how to simply copy a list of files to another location using bash, but the problem is that my list of files contains filenames that contain just about EVERY character that needs to be escaped in bash. There are tons of spaces, !, ",", "'", ?, and just about every other character you could think of that needs to be escaped.
I initially tired going through the text file and escaping all of these characters but it's... exhausting, even with search and replace (however that DOES work) (I tested it with a much smaller list of files.) I also tried adding single quotes in the text file before and after the path, but that doesn't work. I also tried adding single quotes before an after the % after cp, but obviously I have no idea what I'm doing. :) (I do know I'd have to escape single quotes in the text file if I were to somehow surround the file path with single quotes.)
I'm using this command to copy the list of files into another location, but again, it doesn't work with special characters.
cat file.txt | xargs -J % cp % ./folderToMoveto/
I know that there are other commands that do the same thing without having to pipe anything into xargs, and some answers here say that xargs can do it itself, but I haven't gotten those to work, while the above one does work.
Also, I'm on OS X.