Capturing data from the serial monitor

putty.exe download: - Download PuTTY: latest release (0.78) -

There are other terminal programs too that can capture to file, note that terminal programs can interfere with the IDE and starting one can reset the sketch.

or one could write a script in python, or any other favorite programming language.