I am trying to write a line of code to count the number of elements in a txt file per row, when every row has a different number of elements, and save the data into 4 separate variables. all of the elements are ints.
for example:
the file reads: (all numbers separated by a tab)
15 4 6 7
4 2 42
5 32 6 8 7
28 3 8 9 0 21
The resulting variables would be:
a = 4
b = 3
c = 5
d = 6
And what to do if there are lines of the file with different numbers of elements for example 0, 1, 2, 7, 10, and even 100?
So it is not clear what you are going to do.