Thanks Rafael

Sorted:

List = [x, y, P]; // writes 3 columns
heading = ["x,y,P"];
// Add x, y, P column header to csv file, list column values []
csvWrite(List, "Data-output.csv",[],[],[], heading);

Lester


On 17 October 2016 at 11:41, Rafael Guerra <jrafaelbgue...@hotmail.com> wrote:
> 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
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to