This does depend what kind of (text file) you have, and what format it is in.
Smart whois will let you run a batch file on single ip's and resolve them. It is not alway accurate with ripe ranges and others. The most advanced whois that i have seen is bims here on the site. In blm 3.0 Tozz is going to make blm (blocklist manager) do this and as far as I know, it will be the only application that will do this with any sort of accuracy. It will alow for rwhois servers to be called upon for better results and alow one to make a list, like you are trying to make. It will also alow for adding in rwhois servers if they are not already located and stored in blm.
I am looking fowards to seeing Tozz's work

but until then, you can get blm, import your list, convert to single ip's and then save the list and import it into smart whois and run a batch file and save it as an xml file and import that into blm as an xml file and make a pg2/protowall compatable list.
hope this helps.
Note: this is not very accurate, doing it this way. but I think it is the best way atm.
And the program is not free.
http://www.tamos.com/download/main/firstaid