Not sure how much of help this can be, but I find this alot easier....

cat 1.txt | perl -e use Net::CIDR; print join("\n", Net::CIDR::range2cidr(<STDIN>));

1.txt:
192.168.0.1-192.168.0.100...