I know there is a write() method but I can't find the documentation on how to use it.
You can use: Serial.write(F("TEXT")); to send text over the "serial communication".
This basically means that your Arduino will send the text to your PC over the USB emulated COM port.
The magnifying glass button at the top-right of your Arduino IDE's screen will open the "Serial Monitor" here you can see the text that's coming from the Arduino, you can even send text back.
How can I export the readings that are being sent to my Arduino Mega to a file?
You could make your Arduino interface with an SD-card.
Or use that serial connection I told you about.
You could create a program (on the PC) that takes the serial input and stores it into a file. A lot of examples from this should be on the internet.
Another thing might be, to use a more advanced serial terminal. I believe "terminal.exe" allows "logging" to a file.