mirror of
https://github.com/on4kjm/FLEcli.git
synced 2025-01-18 13:01:09 +01:00
Add Nickname header field parsing
This commit is contained in:
parent
5196150ed2
commit
c84b99af62
2 changed files with 32 additions and 3 deletions
19
cmd/load.go
19
cmd/load.go
|
@ -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
|
||||
|
|
16
test/data/fullFeatureHeader.txt
Normal file
16
test/data/fullFeatureHeader.txt
Normal file
|
@ -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…
Reference in a new issue