Synchronize the .annot file with .edf file

Hi,

I have ".edf " file and another file in “.annot”. Would you mind helping me how to sync those files. I checked the .annnot file is like this. AS you can see at some point one section of data have two annotations like following:

|N1|.|.|23:17:37|23:18:07|.|
|apnea|obstructive|.|23:17:42|23:18:21|.|
|desat|.|.|23:18:02|23:18:47|.|

class instance channel start stop meta
W . . 22:55:07 22:55:37 .
W . . 22:55:37 22:56:07 .
W . . 22:56:07 22:56:37 .
W . . 22:56:37 22:57:07 .
W . . 22:57:07 22:57:37 .
W . . 22:57:37 22:58:07 .
W . . 22:58:07 22:58:37 .
W . . 22:58:37 22:59:07 .
W . . 22:59:07 22:59:37 .
W . . 22:59:37 23:00:07 .
W . . 23:00:07 23:00:37 .
W . . 23:00:37 23:01:07 .
W . . 23:01:07 23:01:37 .
W . . 23:01:37 23:02:07 .
W . . 23:02:07 23:02:37 .
W . . 23:02:37 23:03:07 .
W . . 23:03:07 23:03:37 .
W . . 23:03:37 23:04:07 .
W . . 23:04:07 23:04:37 .
W . . 23:04:37 23:05:07 .
W . . 23:05:07 23:05:37 .
W . . 23:05:37 23:06:07 .
W . . 23:06:07 23:06:37 .
W . . 23:06:37 23:07:07 .
W . . 23:07:07 23:07:37 .
W . . 23:07:37 23:08:07 .
W . . 23:08:07 23:08:37 .
W . . 23:08:37 23:09:07 .
W . . 23:09:07 23:09:37 .
W . . 23:09:37 23:10:07 .
W . . 23:10:07 23:10:37 .
W . . 23:10:37 23:11:07 .
W . . 23:11:07 23:11:37 .
W . . 23:11:37 23:12:07 .
W . . 23:12:07 23:12:37 .
W . . 23:12:37 23:13:07 .
W . . 23:13:07 23:13:37 .
W . . 23:13:37 23:14:07 .
W . . 23:14:07 23:14:37 .
W . . 23:14:37 23:15:07 .
W . . 23:15:07 23:15:37 .
W . . 23:15:37 23:16:07 .
W . . 23:16:07 23:16:37 .
N1 . . 23:16:37 23:17:07 .
LM . . 23:16:43 23:16:48 .
LM . . 23:16:51 23:16:56 .
desat . . 23:16:55 23:17:29 .
N1 . . 23:17:37 23:18:07 .
apnea obstructive . 23:17:42 23:18:21 .
desat . . 23:18:02 23:18:47 .

The only way I can think of is to look over the entries on your .annot file “manually” and create an mne.Annotations object from them: mne.Annotations — MNE 1.6.1 documentation