Sorry for the quick answer but the help file provides a clear example.
Rgds

-----Original Message-----
From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of Lester Anderson
Sent: Monday, October 17, 2016 11:28 AM
To: International users mailing list for Scilab. <users@lists.scilab.org>
Subject: [Scilab-users] Adding header to cdvwrite output

Hello,

Quick one; sorry basic query. How do I add a header to an output from
csvWrite (where the input from csvRead had none)?

Test code:

Data = csvRead("Data-test.csv");
// 1,2,3
// 2,4,5
// 3,6,7

// Write variables for X,Y an Z columns from input data file
x = Data(:,1);
y = Data(:,2);
z = Data(:,3);

P = z * 2;

List = [x, y, P]; // writes 3 columns

csvWrite(List, "Data-output.csv",',','.');
// x,y,P
// 1,2,6
// 2,4,10
// 3,6,14


Thanks
Lester

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to