To use code tags, use [ ] and not < >. Also, be sure you indent, otherwise what's the point?
Here is the basic idea:
Code:
read one character, like I did in my example
if the character is a one or zero
increment counter
<< the current value one place
& the new value
if the character is a newline
handle the current value however you need to
(return it, pass it some place, shift it to pad left if that's what you're
doing, whatever)
reset the counter to zero to begin a new word
otherwise, ignore whatever this character is and continue.
As I've illustrated, it's fairly simple. All you have to do is decide if you're left padding your value by the remainder or not (ie: the first byte you read, is it the left most? Or is its "leftness" determined only by the number of "bits" listed on this line?
Quzah.