Published
Edited
Nov 21, 2020
3 forks
Insert cell
md`
# ADIF
`
Insert cell
await toAdifQO100(`
2019-03-17 | 11:03 | LZ1ZB | 599 | 599 | KN12QO | Vlad|
2019-03-17 | 11:34 | HS0AJ | 599 | 599 | OK04SA | Kob|QSL via E21EJC
2019-03-17 | 13:36 | LY5VP | 599 | 599 |KO15PV |Egi|Шауляй
2019-03-17 | 14:12 | ZS1JX | 599 | 599 |JF96RI| Peter| Worchester
2019-03-17 | 14:15 | PA3FYM | 599| 599 | JO22NF | Remco|
2019-03-17 | 14:30 | PY2RN | 599 | 599 | GG66LW | Ed |
2019-03-17 | 14:51 | DD0CW | 599 | 599 |JO51MA | Frank|
2019-03-17 | 15:01 | EW6FS | 559 | 559 | KO35LB | Anton|
`)
Insert cell
toAdifQO100 = desc => {

const text2array = rows =>
((typeof rows === 'string') ? rows.trim().split('\n') : rows)
.map((row, i) =>
((typeof row === 'string') ? row.trim().split('|') : row)
.map(cell => cell.trim()));

let arr = text2array(desc);

return arr.map(e => {
const date = e[0].replace(/-/g, '');
const time = e[1].replace(/:/, '');
const call = e[2];
const mode = (e[3].length === 3) ? 'CW' : 'SSB';
return `<QSO_DATE:8>${date}<TIME_ON:4>${time}<CALL:${call.length}>${call}<MODE:${mode.length}>${mode}<BAND:4>13CM<FREQ:4>2400<BAND_RX:3>3CM <FREQ_RX:5>10489<PROP_MODE:3>SAT<SAT_NAME:6>QO-100
<EOR>

`;
}).join('');
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more