필터 지우기
필터 지우기

Can a format string be supplied to detectImportOptions?

조회 수: 1 (최근 30일)
Daniel Murphy
Daniel Murphy 2018년 3월 9일
답변: dpb 2018년 3월 10일
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?

채택된 답변

dpb
dpb 2018년 3월 10일
Use setvaropts to control properties associated with particular variables; specifically the DatetimeVariableImportOptions properties for datetime data.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by