Export note onset and offset from midi file

Is it possible to export note onset and offset time of a specific midi file in audacity? I have a collection of audio files with their corresponding midi file. I want to export the note onset and offset time in .csv or .txt file from the midi file.

You can export an Audacity “Note track” (MIDI) as a “.GRO” file.
.GRO files can be opened in any “plain text editor” (such as NotePad++)

The .GRO file specification is here: https://www.cs.cmu.edu/~rbd/software/allegro.htm
This does not provide exactly what you want, but the times can be calculated from the information in the .GRO file.