Skip to content
Snippets Groups Projects
Commit c6779297 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

prepare for regex

parent 974f32e0
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ import toml
import sys
import argparse
import numpy as np
import re
class FileExtractor:
......@@ -64,7 +65,10 @@ class FileExtractor:
buf += "{}\n".format(self.__data[key])
return buf
# first pass on file(s)
def re_compile(self):
# first pass on file(s)
def first_pass(self):
'''
Returns
......
......@@ -23,8 +23,9 @@ typeInstrument = "SBE911+"
instrumentNumber = "09P1263"
isHeader = '^[*#]'
isDevice = [ '^\*\s+(Sea-Bird)','(\*END\*)' ]
latitude = ['Latitude\s*:\s*(\d+)\s+(\d+.\d+)\s+(\w)','NMEA Latitude\s*=\s*(\d+\s+\d+.\d+\s+\w)']
longitude = ['Longitude\s*:\s*(\d+)\s+(\d+.\d+)\s+(\w)','NMEA Longitude\s*=\s*(\d+\s+\d+.\d+\s+\w)']
time = 'System UpLoad Time\s*=\s*(\w+)\s+(\d+)\s+(\d+)\s+(\d+):(\d+):(\d+)'
latitude = 'NMEA\s+Latitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)'
longitude = 'NMEA\s+Longitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)'
date = 'Date\s*:\s*(\d+)/(\d+)/(\d+)'
hour = '[Heure|Hour]\s*:\s*(\d+)[:hH](\d+):(\d+)'
bottomDepth = 'Bottom Depth\s*:\s*(\d*\.?\d+?)\s*\S*'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment