Open jpuigs opened 5 years ago
Better would be sorted by start CU.
.. or by name..... In order to suit everybody's wishes,: -- list -> current situation -- list i -> sorted by Subch ID -- list c -> sorted by start CU -- list n -> sorted by name -- list s -> sorted by service ID ....
The code is open source. You could basically do it yourself. Even I did it (and I am not a programmer, just a normal user)
Change https://github.com/piratfm/eti-tools/blob/master/wfficproc.c by separating the fields by a semicolon (which I hope it's not used for service labels) and remove unnecessary text and spaces and numbers, for instance start=%3d
to ;%d;
to have a number, not a text.
Then output the ni2http --list
to a file by piping it with ni2http --list 2> file.txt
(Remark: >
does not work as this is the stderr output), delete the 1st row and then process it with awk
and sort
.
I can post the detailled solution later, but I will not change the code here.
And you can change line 186 in https://github.com/piratfm/eti-tools/blob/master/wfficproc.c#L186
from
int i = 0;
to
int i = 1;
that the 1st service begins with 1, not with 0.
0 : BBC Radio 1 (0xc221) Pri subch= 1 start= 0 CUs= 96 PL=uep 3 bitrate=128
Of course you have to re-compile it by make
in the eti-tools folder.
line 186 was the 1st thing I changed :-) I tried to sort inside wffic.c , but my knownledge of c++ is very very limited, and I didn't success. Each line has 3 elements, Label name, sid, and "rest". so it had to be sorted all of them. I had no problems with sid and "rest", but label name was problematic, and I don't know why. I used classic sort procedure , compare one element with next one, and if it's bigger the first one, then swap with second one. If you could post code, it'll be good.
$ cat output.txt | sed 's/Pri subch=\|start=\|CUs=\|bitrate=\|PL=//g' > output_new.txt
sort by label:
$ cat ./output_new.txt | sed '1d' | sort -t ";" -k2
sort by SId:
$ cat ./output_new.txt | sed '1d' | sort -t ";" -k3
sort by subch (note, you have to specify it as number)
$ cat ./output_new.txt | sed '1d' | sort -t ";" -nk4
sort by start CU (specified as number)
$ cat ./output_new.txt | sed '1d' | sort -t ";" -nk5
sort by used CUs (specified as number)
$ cat ./output_new.txt | sed '1d' | sort -t ";" -nk6
sort by protection level
$ cat ./output_new.txt | sed '1d' | sort -t ";" -k7
sort by bitrate (as number)
$ cat ./output_new.txt | sed '1d' | sort -t ";" -nk8
sort by DAB/DAB+
$ cat ./output_new.txt | sed '1d' | sort -t ";" -k9
You could then save this as alias so that you don't need to re-type them.
Thank's. I'll try.
would it be possible , in ni2http --list option, to get the services list sorted by subchannel ID ?
in order to get this...