Skip to content

Instantly share code, notes, and snippets.

@whoeverest
Forked from markododa/kanali.txt
Last active December 15, 2015 14:19
Show Gist options
  • Save whoeverest/5273331 to your computer and use it in GitHub Desktop.
Save whoeverest/5273331 to your computer and use it in GitHub Desktop.
24 Вести
Македонски
479.25
C22
Alsat M
Регионален
751.25
C56
{24 Вести} 479.25 0 {0} 0
{Alsat M} 751.25 0 {0} 0
#!/usr/bin/python
lines = open('kanali.txt').readlines()
out = open('out.txt', 'w')
while True:
chunk, lines = lines[:4], lines[4:]
if not chunk:
break
name, _, freq, _ = chunk
out.write('{%s} %s 0 {0} 0\n' % (name.strip(), freq.strip()))
out.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment