Add Nickname header field parsing

pull/2/head
Jean-Marc MEESSEN 4 years ago
parent 5196150ed2
commit c84b99af62

@ -83,14 +83,15 @@ func loadFile() {
regexpHeaderMyWwff, _ := regexp.Compile("(?i)^mywwff ")
regexpHeaderMySota, _ := regexp.Compile("(?i)^mysota ")
regexpHeaderQslMsg, _ := regexp.Compile("(?i)^qslmsg ")
// regexpHeaderNickname, _ := regexp.Compile("(?i)^nickname ")
regexpHeaderNickname, _ := regexp.Compile("(?i)^nickname ")
// regexpHeaderDate, _ := regexp.Compile("(?i)^date ")
headerMyCall := ""
headerOperator := ""
headerMyWWFF := ""
headerMySOTA := ""
//headerQslMsg := ""
headerQslMsg := ""
headerNickname := ""
lineCount := 0
var isInMultiLine = false
@ -200,7 +201,19 @@ func loadFile() {
if(regexpHeaderQslMsg.MatchString(eachline)) {
myQslMsgList := regexpHeaderQslMsg.Split(eachline,-1)
if(len(myQslMsgList[1]) > 0) {
cleanedInput = append(cleanedInput, fmt.Sprintf("QSL Message: %s", myQslMsgList[1]))
headerQslMsg = myQslMsgList[1]
cleanedInput = append(cleanedInput, fmt.Sprintf("QSL Message: %s", headerQslMsg))
}
//If there is no data after the marker, we just skip the data.
continue
}
//QSL Message
if(regexpHeaderNickname.MatchString(eachline)) {
myNicknameList := regexpHeaderNickname.Split(eachline,-1)
if(len(myNicknameList[1]) > 0) {
headerNickname = myNicknameList[1]
cleanedInput = append(cleanedInput, fmt.Sprintf("eQSL Nickmane: %s", headerNickname))
}
//If there is no data after the marker, we just skip the data.
continue

@ -0,0 +1,16 @@
# Header
mycall on4kjm/p
operator on4kjm
nickname Portable
myWwff onff-0258
mySota on/on-001
QslMsg This is a QSL message
date 2020-05-23
# Log
40m cw
7.018 0950 ik5zve/5 9 5
7.025 0958 iz2bzt 9 5
7.037 1012 on6zq 9 449
1020 dk5zx 9 7
30m cw
Loading…
Cancel
Save