How to get my serial.print to be written into csv file

Again, Do you want to save it into a file on the Arduino, or have the serial data still received by the PC, and saved to a file there?

Here's another option for the latter:

https://www.windmill.co.uk/serial.html

And an example using Python on the PC: