CSV data manipulation: Difference between revisions

m
(→‎{{header|Ruby}}: Use sum method)
Line 2,720:
 
=={{header|Nanoquery}}==
Nanoquery was created to parse and manipulate data files, with CSV being the first targeted format. As a result, it has a number of operators for retrieving data from a CSV file, including the record operator '#', the column operator '@', and the lookup operator '~'
<lang Nanoquery>def sum($record)
$sum = 0
 
for ($i =in range(1) ($i <=, len($record) - 1) ($i = $i+1)
$sum = $sum + int($record ~ $i)
end for
 
return $sum
end def
 
Line 2,733 ⟶ 2,734:
add "SUM"
 
for ($i =in range($dbsize), ($i > 0) ($i = $i-1)
($i ~ @"SUM") = sum(#$i)
end for
 
write</lang>
 
 
=={{header|NetRexx}}==
Anonymous user