0400-0427 NA Czech Republic R. Prague 5990ca, 6200, 7345
0400-0456 NA, As Romania R. Romania Int'l 6115, 9515, 9690,
11895
0400-0500 NA U. S. A. WYFR 6065, 6855, 9505,
9715
0400-0500 NA,Eu,Af U. S. A. WEWN 5810, 5850
0400-0500 NA Russia V. of Russia 7150, 7350, 9840,
12010,
12030, 13665, 15425
0400-0500 NA China China R. Int'l 6190
0400-0600 Am, Sa U. S. A. WRMI 9955
0400-0600 Am U. S. A. WHRI 5860, 7315 Su-M, 7490
I've been trying to get each station on one line, but I can't seem to get it. Any help is appreciated.
UTC Time Notes Country Station Frequencies
0000-0015 Am, Su U. S. A. WRMI 9955
0000-0030 NA Egypt R. Cairo 11885
0000-0057 NA Netherlands R. Netherlands 6165bo
0000-0059 Am Spain R. Ext. Espana 6055
0000-0100 NA U. S. A. WYFR 6085, 9505, 9715
0000-0100 Am U. S. A. WHRI 7315, 7490
0000-0100 NA Bulgaria R. Bulgaria 7400, 9700
0000-0100 NA Japan R. Japan 6145ca
0000-0100 NA China China R. Int'l 6020al, 9570al
0000-0100 LA U. S. A. WYFR 11720
0000-0100 NA U. S. A. KTBN 7505, 15590
0000-0200 NA U. S. A. WWCR4 7465
0000-0330 NA U. S. A. WBCQ 9330
0000-0400 NA,Eu,Af U. S. A. WEWN 5810
0000-0400 Am U. S. A. WINB 9265
0000-0400 Am, Tu-Sa U. S. A. WRMI 7385
(making some assumptions here):
nawk -f stations.awk myStationFile.txt
stations.awk:
# if a line starts with 'NNNN-' (where N is a number) - output a NewLine (for ALL but the FIRST input line AND the input line withOUT NewLine. And proceed to the next input line
/^[0-9][0-9]*-/ { printf("%s%s" , (FNR==1) ? "" : "\n", $0) ; next }
# OTHERWISE, ouput "," and the line - withOUT a new line.
{ printf "," $0 }
given a sample file in your first post, my output looks like:
0400-0427 NA Czech Republic R. Prague 5990ca, 6200, 7345
0400-0456 NA, As Romania R. Romania Int'l 6115, 9515, 9690,,11895
0400-0500 NA U. S. A. WYFR 6065, 6855, 9505,,9715
0400-0500 NA,Eu,Af U. S. A. WEWN 5810, 5850
0400-0500 NA Russia V. of Russia 7150, 7350, 9840,,12010,,12030, 13665, 15425
0400-0500 NA China China R. Int'l 6190
0400-0600 Am, Sa U. S. A. WRMI 9955
0400-0600 Am U. S. A. WHRI 5860, 7315 Su-M, 7490
Yes you're correct, sorry I must've pasted the first bit of text after I removed the excess whitespace with sed. Anyway, would you mind explaining your solution.