Last active
July 18, 2023 20:11
-
-
Save OH6BG/df9a8d1480e62530f1db7876bb43b18b to your computer and use it in GitHub Desktop.
Create a kiwi-compatible DX label CSV from Eibi CSV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Use at your own risk. | |
""" | |
import csv | |
FILENAME = 'sked-a23.csv' # Eibi CSV file | |
outrow = [] | |
with open(FILENAME, 'r') as inf: | |
reader = csv.reader(inf, delimiter=';') | |
next(reader) # skip the header line | |
for row in reader: | |
khz = float(row[0]) | |
begin, end = row[1].split('-') | |
if begin == "0000": | |
begin = "0001" | |
if end == '2400': | |
end = '2359' | |
day = row[2] | |
itu = row[3] | |
ident = row[4] | |
lang = row[5] | |
target = row[6] | |
rem = row[7] | |
if not rem: | |
notes = f'{itu}. Target: {target}. Lang: {lang}' | |
else: | |
notes = f'{itu} via {rem}. Target: {target}. Lang: {lang}' | |
outrow.append([khz,"QAM",ident,notes,'','','','','','',begin,end]) | |
with open('kiwi.csv', 'w', newline='', encoding='utf-8') as outf: | |
writer = csv.writer(outf, delimiter=';', quotechar='"', quoting=csv.QUOTE_MINIMAL) | |
for row in outrow: | |
writer.writerow(row) | |
""" | |
Remember to sort the lines of kiwi.csv as the frequencies | |
are not perfectly sorted in the original Eibi file | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment