CSV data manipulation: Difference between revisions

(Added Easylang)
 
(One intermediate revision by the same user not shown)
Line 3,116:
4,8,12,16,20,60
"</syntaxhighlight>
 
=={{header|Logo}}==
{{works with|UCB Logo|6.2.4}}
UCBLogo has no built-in support for generic CSV files.
 
<syntaxhighlight lang="logo">to csv.data.manipulation :in :out
local [header line list sum]
openread :in
setread :in
openwrite :out
setwrite :out
make "header readword
print word :header ",SUM
while [not eofp] [
make "line readword
make "list parse map [ifelse equalp ? ", ["\ ] [?]] :line
make "sum apply "sum :list
print (word :line "\, :sum)
]
close :in
setread []
close :out
setwrite []
end</syntaxhighlight>
 
<syntaxhighlight lang="logo">csv.data.manipulation "data.csv "output.csv</syntaxhighlight>
 
{{out}}
<pre>
Contents of output.csv
 
C1,C2,C3,C4,C5,SUM
1,5,9,13,17,45
2,6,10,14,18,50
3,7,11,15,19,55
4,8,12,16,20,60
</pre>
 
=={{header|Lua}}==