%% Set up the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables", 33);

% Specify range and delimiter
opts.DataLines = [25, Inf];
opts.Delimiter = ",";

% Specify column names and types
opts.VariableNames = ["LVDateTime", "ThermistorTemp", "BathTemp", "BathSetPoint", "PressuredBar", "MaxFlow", "FlowRate", "PumpVolume", "CRC",           "ID",       "DATETIME", "UTCSECS", "CTDDEPTH", "CTDTEMP", "CTDSALINITY", "SAMPLECOUNTER", "RESETCOUNTER", "ERRORCOUNTER", "HOUSINGTEMPERATURE", "HOUSINGHUMIDITY", "INPUTVOLTAGE", "INPUTCURRENT", "FOOBARPHVALUE", "BACKUPBATTERY", "VRSVOLTS", "VRSSTDDEV", "VKVOLTS", "VKSTDDEV", "IKAMPS", "IBAMPS", "Set_temp", "Set_pres", "StepNum"];
opts.VariableTypes = ["datetime",   "double",           "double", "double",         "double",       "double", "double",     "double", "categorical", "categorical", "datetime", "double",   "double",   "double", "double",         "double",       "double",       "double",       "double",           "double",           "double",       "double",       "double",           "string",   "double",       "double", "double",     "double", "double", "double", "double", "double", "string"];

% Specify file level properties
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";

% Specify variable properties
opts = setvaropts(opts, ["BACKUPBATTERY", "StepNum"], "WhitespaceRule", "preserve");
opts = setvaropts(opts, ["CRC", "ID", "BACKUPBATTERY", "StepNum"], "EmptyFieldRule", "auto");
opts = setvaropts(opts, "LVDateTime", "InputFormat", "MM/dd/yyyy hh:mm:ss aa");
opts = setvaropts(opts, "DATETIME", "InputFormat", "MM/dd/yyyy HH:mm:ss");

fullPath = "\\atlas\projectlibrary\ChemSensors\GeneM\GDF pH Sensor\Calcs\pHCalGui\SURpH009_120424_Ch BMod.csv";

% Import the data
cvsTable = readtable(fullPath, opts);


%% Clear temporary variables
clear opts