From 36dd84d369cb9c5997004dc49c617c1e3881f1dc Mon Sep 17 00:00:00 2001 From: Jean-Marc Meessen Date: Tue, 23 Jun 2020 12:02:27 +0200 Subject: [PATCH] Some display tweeking after testing with real files --- cmd/display.go | 2 +- cmd/parse_line.go | 10 +++------- test/data/ON4KJM@ONFF-025920200524.txt | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cmd/display.go b/cmd/display.go index 99ef2a0..4fa20da 100644 --- a/cmd/display.go +++ b/cmd/display.go @@ -64,7 +64,7 @@ func SprintHeaderValues(logLine LogLine) (output string){ return output } // Date, Time, band, mode, call, report sent, report rcvd, Notes -var logLineFormat = "%10s %4s %4s %4s %10s %4s %4s %s \n" +var logLineFormat = "%-10s %-4s %-4s %-4s %-10s %-4s %-4s %s \n" // SprintColumnTitles displays the column titles for a log line func SprintColumnTitles(logLine LogLine) (output string){ diff --git a/cmd/parse_line.go b/cmd/parse_line.go index b122271..cd71715 100644 --- a/cmd/parse_line.go +++ b/cmd/parse_line.go @@ -19,7 +19,6 @@ limitations under the License. import ( "regexp" "strings" - "fmt" ) //TODO: validate a record for minimal values @@ -75,6 +74,9 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg previousLine.RSTrcvd = "" previousLine.SOTA = "" previousLine.WWFF = "" + previousLine.OMname = "" + previousLine.GridLoc = "" + previousLine.Comment = "" logLine = previousLine //TODO: what happens when we have <> or when there are multiple comments @@ -82,13 +84,11 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg comment,inputStr := getBraketedData(inputStr, COMMENT) if comment != "" { logLine.Comment = comment - fmt.Println("Cleaned input string: ", inputStr) } QSLmsg,inputStr := getBraketedData(inputStr, QSL) if QSLmsg != "" { logLine.QSLmsg = QSLmsg - fmt.Println("Cleaned input string: ", inputStr) } @@ -231,10 +231,6 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg _, logLine.RSTrcvd = getDefaultReport(logLine.Mode) } - //Debug - fmt.Println(elements, len(elements)) - fmt.Println("\n", SprintLogRecord(logLine)) - return logLine, errorMsg } diff --git a/test/data/ON4KJM@ONFF-025920200524.txt b/test/data/ON4KJM@ONFF-025920200524.txt index 55d50ee..f481fe6 100644 --- a/test/data/ON4KJM@ONFF-025920200524.txt +++ b/test/data/ON4KJM@ONFF-025920200524.txt @@ -13,14 +13,14 @@ date 2020-05-24 20 iw3iee 25 oe7hhw 5 9 37 ol90crk 5 9 -14.047 42 oe6jtd 3 9 Name Joe, qth Gratz +14.047 42 oe6jtd 3 9 14.060 1405 hb9fbg/qrp 5 9 30m cw 10.124 1415 hb9ijc 8 9 25 f6acv 7 9 27 dl5sfc/p 5 5 -29 dl6ta 449 5 qrpp +29 dl6ta 449 5 pa1tt 35 ik4gbu 5 9 38 oh6mps