in reply to convert a comma delimited file to a fixed length

The module solutions above will be the most robust .. Just wanted to throw one more into the mix for the sake of TMTOWTDI:
perl -pe 's/([^,]*),/ $1 . " "x(10-length($1))/eg' foo.txt