From 2e97cf39200ededa938bbe6f37d11a4d75eaa2e6 Mon Sep 17 00:00:00 2001 From: Jean-Marc MEESSEN Date: Mon, 1 Jun 2020 10:22:56 +0200 Subject: [PATCH] start coding the header processing --- cmd/load.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmd/load.go b/cmd/load.go index 50687f7..fced0de 100644 --- a/cmd/load.go +++ b/cmd/load.go @@ -77,6 +77,13 @@ func loadFile() { regexpSingleMultiLineComment, _ := regexp.Compile("^{.+}$") regexpStartMultiLineComment, _ := regexp.Compile("^{") regexpEndMultiLineComment, _ := regexp.Compile("}$") + regexpHeaderMyCall, _ := regexp.Compile("(?i)^mycall ") + // regexpHeaderOperator, _ := regexp.Compile("(?i)^operator ") + // regexpHeaderMyWwff, _ := regexp.Compile("(?i)^mywwff ") + // regexpHeaderMySota, _ := regexp.Compile("(?i)^mysota ") + // regexpHeaderQslMsg, _ := regexp.Compile("(?i)^qslmsg ") + // regexpHeaderNickname, _ := regexp.Compile("(?i)^nickname ") + // regexpHeaderDate, _ := regexp.Compile("(?i)^date ") var isInMultiLine = false @@ -116,6 +123,15 @@ func loadFile() { // ** Process the data line // **** + //** is it a Header line? + if(regexpHeaderMyCall.MatchString(eachline)) { + myCallList := regexpHeaderMyCall.Split(eachline,-1) + fmt.Println(len(myCallList)) + fmt.Println("myCallList", myCallList) + fmt.Println(myCallList[1]) + continue + } + fmt.Println(eachline) } } \ No newline at end of file