Improved partition resizing algorithm.

Testing with different sizes and numbers of partitions revealed that previous logic was broken by different number of spaces between fields (columns).   This method is more robust.