フィルターのクリア

can't import datastore

4 ビュー (過去 30 日間)
harel yadid
harel yadid 2021 年 3 月 16 日
コメント済み: harel yadid 2021 年 3 月 22 日
hi guys,
i'm trying to upload my files to a datastore with the line:
Myds = datastore(MyAdress,'IncludeSubfolders',true,'FileExtensions','.csv','Type','taulartext','TreatAsMissing','NA'...
'MissingValue',0,'DataTimeType','text')
it worked great with my files so far, but i just recieved a new data, and apperently now it is not able to read it.
the error i recieve is as follows :
Cannot detect TextScanFormats from file: "...........\......\....." . Specifty TexstScanFormats when you create the datastore. Verify te Text Format and Advanced Text Format Properties.
i went into the problematic file and i realized it's the first file on the first folder, and apperently he only has the headers but no data (it can happen some times but didn't have this problem with reading it so far. the other files in the list are full of data (around 10Gb))
how can i solve this problem?
what i tried :
  1. play with the TextScanFormats, no success so far. "%f" and "%s" both failed
  2. reading if some1 else had the same problem but couldn't find
i am using matlab 2020

回答 (1 件)

Rashed Mohammed
Rashed Mohammed 2021 年 3 月 19 日
Hi harel,
You can mitigate the issue by using the TextscanFormats Name-Value pair while creating the datastore. Note that you must specify the textscan format for each column/variable of the table.
For example, if the file has 5 columns with the 3rd column being a character array and the rest are numbers, then the value of the TextscanFormats name-value pair would be {'%f','%f','%q','%f','%f'}
Hope this helps.
  1 件のコメント
harel yadid
harel yadid 2021 年 3 月 22 日
hi Rashed, i'm afraid this tactic won't do any good since i have more then 1900 different coloumns

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by