By data you probably mean "number"? Since it could be anything, like "date" or "location" or something, and since you do not provide any example of your data, I assume the following:
your output looks something like this:
You want to have it formatted as a two columns of numbers that you can e.g. sum up in the spreadsheet.
One solution could be this:
- Save the output in a file (e.g. by running your program with like this:
myprogram >> mydatafile.txt
- Open the file with libreoffice (or openoffice). This should look like the following:
Take care to select the correct separator (whatever is between your columns, here it is a space, but your program could write commas between the numbers...).
- Click on "OK" to import.
- Now your spreadsheet should look like this:
- And you can use summation over the cells: