Effacer les filtres
Effacer les filtres

Can a format string be supplied to detectImportOptions?

1 vue (au cours des 30 derniers jours)
Daniel Murphy
Daniel Murphy le 9 Mar 2018
Réponse apportée : dpb le 10 Mar 2018
I'm importing data from a text file and I'd like to do something like the following:
opts = detectImportOptions(filePath,'FileType','Text');
% manually change a couple of options
opts.DataLine = numHeaderLines + 1;
opts.Delimiter = {','};
% import
thisFile = readtable(filePath,opts,'Format','%{dd-MMM-yyyy HH:mm:ss.SSS}D%s%d');
However, I can't use the 'Format' Name-Value pair when passing opts to readtable as an argument. Is there any way to supply a format string in this situation?

Réponse acceptée

dpb
dpb le 10 Mar 2018
Use setvaropts to control properties associated with particular variables; specifically the DatetimeVariableImportOptions properties for datetime data.

Plus de réponses (0)

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by