Once the coffee's taken effect, here's your bonus section -- arrays and loops!
This kind of "working through a list" is perfect for loops -- you use a "For Each" action in your macro. But think of how you'd wrangle the list of numbers by hand -- left index finger on the first line, keep it there to hold your place, put your right index finger there and look at the number, move right finger down one line, look at the number... Once you've moved your right finger down to account for all the columns you jump your left finger down to that point as a place holder and start all over again at that point with your right finger.
Easier to do than explain -- print the numbers out and give it a go
So what you got is a loop within a loop. Better yet, that "inner" loop going "1, 2, 1, 2,..." matches your column numbers and you can use that to decide which column to add to. Array elements can be referenced by index, so we can use an array and our inner loop numbers to do the totalling.
Exactly how you do that depends on the language, but here's an AppleScript example because AppleScript is "readable" and indexes its lists (a poor man's array) from 1 rather than JavaScript's 0 which makes things easier to understand.
I've used your numbers but repeated the last 4 rows to give 30 lines -- the 2-column totals won't match but it means you can change numOfCols
to 2, 3, 5, 6, or 10 to see how versatile such a simple approach can be.
Pop the following into a new Script Editor document, press the "Run" button, see the list of totals (one number per column) in the Results window. Change numOfCols
and see what happens... (Note: There's way more "here's a list" and comments than there is actual code!)
Summary
-- Our return-delimited list of numbers
-- Note that empty lines will be treated as an
-- entry with the value of '0'
set theList to "59
0.0053
67
0.0014
88
0.0024
135
0.0017
294
0.0105
740
0.0421
12049
0.1021
383
0.0150
482
0.0190
370
0.0158
440
0.0184
383
0.0161
431
0.0181
383
0.0161
431
0.0181"
-- Set the number of columns you want here
set numOfCols to 2
-- This gets our "end of list" condition for the outer loop"
set numOfLines to count of paragraphs of theList
-- Initialise the "Totals" list to the right length, every value as '0'
set totalsList to {}
repeat numOfCols times
set end of totalsList to 0
end repeat
-- Set our outer loop start to the first line of the text
set i to 1
-- and do the actual work
repeat while i < numOfLines
-- Each time we restart the inner loop we set its counter to 0
-- Using 0 means we have to add 1 to access the correct element of
-- totalsList, but it can be used unmodified as the line counter 'offset'
-- when we access the text
set j to 0
repeat while j < numOfCols
set item (j + 1) of totalsList to (item (j + 1) of totalsList) + (paragraph (i + j) of theList)
set j to j + 1
end repeat
-- after the inner loop finishes, jump down the text list a number lines
-- equal to our number of columns
set i to i + numOfCols
end repeat