%% Import data from text file
% Script for importing data from the following text file:
%
%    filename: C:\Users\magene\Documents\GDF\Data\GDFLionixV2\GDFL003_113023_ChB.csv
%
% Auto-generated by MATLAB on 04-Dec-2023 13:08:49

%% 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 aa");
opts = setvaropts(opts, "DATETIME", "InputFormat", "MM/dd/yyyy HH:mm:ss");

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


%% Clear temporary variables
clear opts