%% Move Variable
% Create a table and move variables one at a time. You can specify variables by name or by position in the table.
% Read data from a spreadsheet into a table. Display the first three rows.

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

%
% Move the variable that is named Region so that it is before the variable named Cause.

T2 = movevars(T1,'Region','Before','Cause');
head(T2,3)

%
% Move the fourth variable so that it is after the first variable.

T3 = movevars(T2,4,'After',1);
head(T3,3)

% Copyright 2012 The MathWorks, Inc.