%% Import data from text file
% Script for importing data from the following text file:
%
%    filename: \\atlas\projectlibrary\CPF\CPF003\Data\TankTests\2023-11-2T23-24-9\CPF003.001V3.eng
%
% Auto-generated by MATLAB on 25-Apr-2024 13:29:54

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

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

% Specify column names and types
opts.VariableNames = ["STX", "Date", "Time", "State", "Comment", "Pressure", "BelPos", "PumpMilliamps", "PumpMilliVolts", "PumpMicroWatts", "PumpMilliSeconds", "PumpUCoulombs", "PumpNanoJoules", "HotelMilliamps", "HotelMilliVolts", "HotelMicroWatts", "HotelMilliSeconds", "HotelUCoulombs", "HotelNanoJoules", "pumpMotorMsg", "CTDTemp", "CTDSal", "RawPress", "LPFPress", "LPFVel", "DiffVel", "Diff2Vel", "SlopeLPFPress", "CTDSamplePeriod", "LPS331Press", "LPS331Temp", "SHT21Humid", "SHT21Temp", "pidSP", "pidPV", "pidY1", "pidY2", "pidI", "pid_v", "pid_u", "pid_uCPS", "pid_h", "FLBB", "Topt", "Tphase", "Rphase", "NO3", "pHVrs", "OCRtext", "OCRCh1", "OCRCh2", "OCRCh3", "OCRCH4", "GPS", "IridModem", "MSC", "VarName57"];
opts.VariableTypes = ["categorical", "datetime", "datetime", "categorical", "string", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "string", "string", "string", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "string", "string", "string", "string", "double", "string", "string", "double", "double", "double", "double", "string", "string", "string", "string"];

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

% Specify variable properties
opts = setvaropts(opts, ["Comment", "pumpMotorMsg", "CTDTemp", "CTDSal", "FLBB", "Topt", "Tphase", "Rphase", "pHVrs", "OCRtext", "GPS", "IridModem", "MSC", "VarName57"], "WhitespaceRule", "preserve");
opts = setvaropts(opts, ["STX", "State", "Comment", "pumpMotorMsg", "CTDTemp", "CTDSal", "FLBB", "Topt", "Tphase", "Rphase", "pHVrs", "OCRtext", "GPS", "IridModem", "MSC", "VarName57"], "EmptyFieldRule", "auto");
opts = setvaropts(opts, "Date", "InputFormat", "dd-MMM-yyyy");
opts = setvaropts(opts, "Time", "InputFormat", "HH:mm:ss");
opts = setvaropts(opts, "NO3", "TrimNonNumeric", true);
opts = setvaropts(opts, "NO3", "ThousandsSeparator", ",");

% Import the data
CPF003 = readtable("\\atlas\projectlibrary\CPF\CPF003\Data\TankTests\2023-11-2T23-24-9\CPF003.001V3.eng", opts);


%% Clear temporary variables
clear opts