Subj : Re: -Unpublished- with speed > 300 To : Wilfred van Velzen From : Nigel Reed Date : Sat Dec 09 2023 08:53:10 Re: Re: -Unpublished- with speed > 300 By: Wilfred van Velzen to Nigel Reed on Sat Dec 09 2023 14:04:34 > NR> cat nodelist|grep -i unpublished|cut -f3- -d,|grep -v ,300,|grep > NR> -v ,300$ > > NR> This will work on a dos2unix'd version of the nodelist. > > NR> wc -l on the above is 79. > > This seems unnecessarily complex, and it requires the dos2unix step, which > requires an extra edit because my dos2unix at first regards the file as a > binary file because of the ^Z at the end, and refuses to convert it. That's what the force option is for :) > And for me it gives 82. But that is because it also counts these lines in > the Z2 version of the nodelist: > > ;S The use of all zero telephone numbers instead of "-Unpublished-" for > ;S MakeNl that allows the use of "-Unpublished-" without Pvt for IP only So add |grep -v ^; There's nothing really complex about it. You find all the lines with unpublished, then you cut off the first couple of fields that may have a 300 in the network or node number, then you remove anything with ,300, in it, and then anything with 300 at the end of the line, and then if you add grep -v ^; it'll remove anything with a semi colon at the start of the line. I'm sure some genius will come up with an awk version but it won't be easier to understand, or you could write a perl script to do it, I'm sure. > Bye, Wilfred. Toodles. .