%% Specify Multiple Variables
% Move multiple table variables using the movevars function. You can specify variables by name or by position.
% Read data from a spreadsheet into a table.

T1 = readtable('outages.csv');
head(T1,3)

%
% Move the variables named Loss, Customer, and Cause so that they are before the first variable. Specify names using a cell array of character vectors.

T2 = movevars(T1,{'Loss','Customers','Cause'},'Before',1);
head(T2,3)

%
% Move the first four variables of T2 so that they are after RestorationTime.

T3 = movevars(T2,[1:4],'After','RestorationTime');
head(T3,3)

% Copyright 2012 The MathWorks, Inc.