%% Import data from text file
% Script for importing data from the following text file:
%
%    filename: /Volumes/Data2/TaraEuropa/Partner_data/CNR-P/DOC&TOC_CNR-P_NoQC.txt
%
% Auto-generated by MATLAB on 21-Feb-2024 09:19:54

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

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

% Specify column names and types
opts.VariableNames = ["Cruise", "Station_N", "date_ddmmyyyy", "Latitude_N", "Longitude_E", "TimeStart_UTC", "Depthm", "SurfaceSAL", "SurfaceTEMPC", "FluorescencegL", "Turbidity_Mean", "Bathymetrym", "DOC_MeanuM", "DOC_StDevuM", "TOC_MeanuM", "TOC_StDevuM"];
opts.VariableTypes = ["double", "double", "datetime", "double", "double", "datetime", "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, "date_ddmmyyyy", "InputFormat", "MM/dd/yyyy");
opts = setvaropts(opts, "TimeStart_UTC", "InputFormat", "HH:mm:ss");
opts = setvaropts(opts, "Cruise", "TrimNonNumeric", true);
opts = setvaropts(opts, "Cruise", "ThousandsSeparator", ",");

% Import the data
A = readtable("/Volumes/Data2/TaraEuropa/Partner_data/CNR-P/DOC&TOC_CNR-P_NoQC.txt", opts);


%% Clear temporary variables
clear opts

save CNR_DOC_TOC A