Why do I have a ‘No such file or directory error’ when I have created the file in the block of code?

I have a directory of csv files which I would like to read, extract the required information, and then save this as another csv file in another directory. I have defined blocks of code to complete the process I require, however I have run into a ‘No file or directory’ error when trying to test […]