matir / adifparser Goto Github PK
View Code? Open in Web Editor NEWParser of ADIF files written in go.
License: BSD 2-Clause "Simplified" License
Parser of ADIF files written in go.
License: BSD 2-Clause "Simplified" License
I'm interested in capturing app-defined fields without knowing the field names a priori. Exposing a method that would return a slice of the keys from r.values
would be ideal.
I used https://github.com/k0swe/lotw-qsl/blob/main/cmd/lotw-qsl/main.go to download a log of my LotW activity. A snippet of the end of the file:
<CALL:5>K7WXB^M
<BAND:3>40M^M
<FREQ:7>7.07505^M
<MODE:3>FT8^M
<APP_LoTW_MODEGROUP:4>DATA^M
<QSO_DATE:8>20200901^M
<APP_LoTW_RXQSO:19>2020-10-21 04:59:04 // QSO record inserted/modified at LoTW^M
<TIME_ON:6>222600^M
<APP_LoTW_QSO_TIMESTAMP:20>2020-09-01T22:26:00Z // QSO Date & Time; ISO-8601^M
<QSL_RCVD:1>Y^M
<QSLRDATE:8>20201021^M
<APP_LoTW_RXQSL:19>2020-10-21 04:59:04 // QSL record matched/modified at LoTW^M
<DXCC:3>291^M
<COUNTRY:24>UNITED STATES OF AMERICA^M
<APP_LoTW_DXCC_ENTITY_STATUS:7>Current^M
<PFX:2>K7^M
<APP_LoTW_2xQSL:1>Y^M
<GRIDSQUARE:8>DN40DA49^M
<STATE:2>UT // Utah^M
<CNTY:7>UT,UTAH // Utah^M
<CQZ:2>03^M
<ITUZ:2>06^M
<eor>^M
^M
<APP_LoTW_EOF>^M
^M
I then tried to parse it, but it seems the <APP_LoTW_EOF>
tag is causing an issue resulting in the error Invalid field definition.
I'm finally in a position where I want to mutate an ADIF record (actually, create a new ADIFRecord and fill it from a proto, the reverse of this file). Despite the fact that there's the NewADIFRecord
function for creating an empty ADIFRecord
, there appears to be no way currently to mutate an ADIFRecord
.
I'm going to send a PR to fix this.
This does not build.
./adifrecord.go:118:16: undefined: ErrNoSuchField
Originally posted by @xylo04 in #14 (comment)
Description:
If there are blank characters in the field content, for example: <comment:3>C: <eor>
,adifreader.go#ReadRecord will be panic.
Panic:
panic: runtime error: slice bounds out of range [3:2] [recovered]
panic: runtime error: slice bounds out of range [3:2]
......................
<Path>/vendor/github.com/Matir/adifparser/adifrecord.go:119 +0x528
github.com/Matir/adifparser.ParseADIFRecord({0xc0000f2400, 0xd, 0x400})
<Path>/vendor/github.com/Matir/adifparser/adifrecord.go:69 +0x18e
github.com/Matir/adifparser.(*baseADIFReader).ReadRecord(0xc0000d0b00)
<Path>/vendor/github.com/Matir/adifparser/adifreader.go:51 +0x105
Possible problems:
https://github.com/Matir/adifparser/blob/master/adifreader.go#L166
VY 73 DE BI1NIZ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.