Public
Edited
Apr 18, 2021
Insert cell
Insert cell
Insert cell
res1 = readAdif(adif)
Insert cell
res2 = groupAdif(res1)
Insert cell
res3 = toCabrillo(res2)
Insert cell
Insert cell
Insert cell
Insert cell
toCabrillo = arr => {
const res = [''];
arr.map(row => {
if (row.type !== 'row') {
return;
}
const freq = (row.FREQ === '2400') ? ' 2.3G' : row.FREQ; // row.FREQ
const mode = (row.MODE === 'SSB') ? 'PH' : row.MODE; // other modes ?
const date = row.QSO_DATE.slice(0,4) + '-' + row.QSO_DATE.slice(4,6) + '-' + row.QSO_DATE.slice(6,8);
const time = row.TIME_OFF;
const callSent = row.STATION_CALLSIGN.padEnd(13);
const rstSent = row.RST_SENT.slice(0,3);
const exchSent = row.RST_SENT.slice(3).padEnd(6);

const callRcvd = row.CALL.padEnd(13);
const rstRcvd = row.RST_RCVD.slice(0,3);
const exchRcvd = row.RST_RCVD.slice(3).padEnd(6);
return res.push(['QSO:', freq, mode, date, time, callSent, rstSent, exchSent, callRcvd, rstRcvd, exchRcvd].join(' '));
});
res.push('END-OF-LOG:')
res.push('000000000111111111122222222223333333333444444444455555555556666666666777777777788');
res.push('123456789012345678901234567890123456789012345678901234567890123456789012345678901');
res.push('')
return res.join('\n');
}
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