textscan don't read file correctly

5 ビュー (過去 30 日間)
michael
michael 2022 年 1 月 16 日
回答済み: Image Analyst 2022 年 1 月 16 日
Hi,
I have preaty old MATLAB version (R14 SP3)
I have 2 files which has to be imported: column headers and data (output of some other application)
In order to read big data files (300K rows), I'm using textscan (which seems to be the fastest method) for do it.
For header files I'm doing some manipulation (removing spaces, replacing some words...) and generating the format string (either it is text, number,...) that is passed to the textscan.
The problem is that it is not always working. In some cases I'm receiving a single row of text instead of many many rows.
Any idea how to debug the issue?
  1 件のコメント
Voss
Voss 2022 年 1 月 16 日
Can you attach some sample header and data text files (maybe one pair of files that works and one pair that doesn't), and post your code for calling textscan() as well as what the expected output should be in the case where textscan() doesn't give the correct output? Thanks.

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

回答 (1 件)

Image Analyst
Image Analyst 2022 年 1 月 16 日
That's not big at all.
Try other functions like dlmread(), readcell(), readmatrix(), importdata(). Maybe one of them will work right out of the box.

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

タグ

製品


リリース

R14SP2

Community Treasure Hunt

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

Start Hunting!

Translated by