필터 지우기
필터 지우기

How to create a tabularTextDatastore with multiple files in subfolders?

조회 수: 3 (최근 30일)
This is my first attempt at datastores. I have a folder with multiple sub-folders, each subfolder currently contains 1 csv file (though they might contain more in the future).
I create the object using the following code:
ds = tabularTextDatastore( '~/data/folder_with_subfolders/*' );
This generates the following error: Error using tabularTextDatastore (line 93). Not enough input arguments.
I have tried a number of different things:
  • instead of the wildcard, I included the 'IncludeSubfolders', true name/value pair;
  • tried adding headers to the CSV file in case that was needed for creating column names;
  • renamed the file to a simple name.csv (currently the files are automatically generated from a database);
  • specified the .csv FileExtensions option...
The documentation shows how to create a datastore from one csv file, but that is not my use case... What am I missing? Thanks!

채택된 답변

Walter Roberson
Walter Roberson 2020년 8월 19일
What shows up for
which -all tabularTextDatastore
In your release, line 93 should be a comment, with there not being any executable code until about line 120.
  댓글 수: 1
Stepp Gyogi
Stepp Gyogi 2020년 8월 19일
Thank you so much I was becoming nuts with this thing!
You were absolutely correct: some old "toolboxes" which I had modified were included in my personal path (I have some automation in my startup file for automatically including a bunch of things in my path to make my life "easier" most of the time). The tabularTextDatastore file was conflicting.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by