Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
24
Task/CSV-data-manipulation/REXX/csv-data-manipulation.rexx
Normal file
24
Task/CSV-data-manipulation/REXX/csv-data-manipulation.rexx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* REXX ***************************************************************
|
||||
* extend in.csv to add a column containing the sum of the lines' elems
|
||||
* 21.06.2013 Walter Pachl
|
||||
**********************************************************************/
|
||||
csv='in.csv'
|
||||
Do i=1 By 1 While lines(csv)>0
|
||||
l=linein(csv)
|
||||
If i=1 Then
|
||||
l.i=l',SUM'
|
||||
Else Do
|
||||
ol=l
|
||||
sum=0
|
||||
Do While l<>''
|
||||
Parse Var l e ',' l
|
||||
sum=sum+e
|
||||
End
|
||||
l.i=ol','sum
|
||||
End
|
||||
End
|
||||
Call lineout csv
|
||||
'erase' csv
|
||||
Do i=1 To i-1
|
||||
Call lineout csv,l.i
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue