if you know in advance how many lines/files you're processing you can do this, otherwise you can only display a bar that lenghtens by a unit each time you start processing another file.
you basically have to insert a printing statement without a \n in the loop of the file/line processing statements.
i've done this a few times, let me know if that didnt help :)