%% Import data from text file
% Script for importing data from the following text file:
%
%    filename: C:\Users\magene\Documents\GDF\Data\GDFLionixV2\LioniX03_11162023_Ch F.csv
%
% Auto-generated by MATLAB on 28-Nov-2023 09:00:07

%% 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 = ["LabviewDateTime", "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", "string", "categorical", "datetime", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double"];

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

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

% Import the data
dataTable = readtable("C:\Users\magene\Documents\GDF\Data\GDFLionixV2\GDFL003_113023_ChB.csv", opts);


%% Clear temporary variables
clear opts