do a "if ubound($line)>21 ... endif" arounf the print statement.

You can't guarantee there are 21 elements on each line