How to write a text file from Arduino to Computer?

Does anyone know a libray to write a string from the Arduino to a text file on the PC or something like that?

Thanks!

The Arduino cannot write directly to a file on a PC. A PC program has to do the file operations.

I use Serial.print from the Arduino, and (instead of the serial monitor), use a terminal program like Teraterm or Putty to write the incoming data to a log file.

Another possibility is to use Excel and the macro PLX-DAQ to capture serial data and create a spreadsheet.

I believe the latest version(s) of Excel have their own facility to receive data via serial from Arduino.

Yes. Thanks for pointing this out.
There is "Data Streamer" which looks pretty good in my simple test.
https://support.microsoft.com/en-us/office/enable-the-data-streamer-add-in-70052b28-3b00-41e7-8ab6-8a9f142dffeb

That's the term I couldn't think of!