RosettaCodeData/Task/CSV-data-manipulation/Yabasic/csv-data-manipulation.basic

17 lines
358 B
Plaintext

open #1, "manipy.csv", "r" //existing CSV file separated by spaces, not commas
open #2, "manip2.csv", "w" //new CSV file for writing changed data
line input #1 header$
header$ = header$ + ",SUM"
print #2 header$
while !eof(1)
input #1 c1, c2, c3, c4, c5
sum = c1 + c2 + c3 + c4 + c5
print #2 c1, c2, c3, c4, c5, sum
wend
close #1
close #2
end