I'm currently creating a macro to open a .txt file in Excel 2010, manipulate it, then overwrite the .txt file. My issue is arriving in several places.
The basic layout of the macro is to open a list of .txt files (approx 900) one at a time. Each file contains 100 rows of data, however I'm manipulating the number of columns. Is there a way to find the max number of columns per file, then for each row that doesn't meet this length I would move the contents in its last available column over to equal the max and input 0 in the resulting spaces. Afterwards overwrite the .txt file. I s there a simple way to scan and find the max number?

Ex. Sample File
1 20 45 59 78 2
2 13 33 1
3 48 84 90 200 2
etc....

into

1 20 45 59 78 2
2 13 33 0 0 1
3 48 84 90 200 2
etc....