Hello All,
Its been a week since I started learning Python, and its been wonderful. This is the problem I am trying to solve.
There are 20 text files (In1.txt, In2.txt,....,In20.txt) in a folder. Each text file has 150000 rows. Each of the 150000 rows has a vector of float values. The number of elements in each row is a variable. Across all the input files, I would like to add the elements by row. I am not sure how to do this. Any help/pointers would be of great value. Thanks
Example:
Input-
In1.txt
L1 - 2.0, 3.0, 4.0, 3.0, 5.0
L2 - 6.0, 3.0, 10.0
L3 -
.
.
L150000 - 15.0
In2.txt
L1 - 2.0, 3.0
L2 - 6.0, 3.0, 10.0, 4.0, 3.0, 5.0
L3 - 7.0
.
.
L150000 - 0.2,10.5
Output-
Output.txt
L1 - 4.0, 6.0, 4.0, 3.0, 5.0
L2 - 12.0, 6.0, 20.0, 4.0, 3.0, 5.0
L3 - 7.0
.
.
L150000 - 15.2, 10.5