I have a .csv with a column called 'Name' listing individuals in Firstname MI. Lastname format:
- Stephen A. Johnson.
And I have a folder full of files made by these individuals in lastnamefirstname format:
- johnsonstephen_78938
Using the list of names I need to find the files that match and save those files to a separate folder.
What is the best way to do this?
Model
Let's prepare some space to model:
Now the main part. There's at least one pitfall:
casefoldversuslowerwhen applied to the original names. This may influence on the file names selected and should be consciously resolved on your side. I usecasefoldand the name"Reiß"to demonstrate how it might appear.Check the result and clean up the space:
Expected output:
P.S. Alternatively, when loading a csv file, we can interpret whitespace characters as a delimiter:
Real life