Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/CSV-data-manipulation/BaCon/csv-data-manipulation.bacon
Normal file
19
Task/CSV-data-manipulation/BaCon/csv-data-manipulation.bacon
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
OPTION COLLAPSE TRUE
|
||||
OPTION DELIM ","
|
||||
|
||||
csv$ = LOAD$("data.csv")
|
||||
|
||||
DOTIMES AMOUNT(csv$, NL$)
|
||||
line$ = TOKEN$(csv$, _, NL$)
|
||||
|
||||
IF _ = 1 THEN
|
||||
total$ = APPEND$(line$, 0, "SUM")
|
||||
ELSE
|
||||
line$ = CHANGE$(line$, _, STR$(_*10) )
|
||||
total$ = APPEND$(total$, 0, line$, NL$)
|
||||
total$ = APPEND$(total$, 0, STR$(LOOP(i, AMOUNT(line$), VAL(TOKEN$(line$, i)))) )
|
||||
FI
|
||||
DONE
|
||||
|
||||
SAVE total$ TO "data.csv"
|
||||
PRINT total$
|
||||
Loading…
Add table
Add a link
Reference in a new issue