How to put big text into an array

1 回表示 (過去 30 日間)
mt
mt 2014 年 10 月 27 日
回答済み: Siddharth Sundar 2014 年 10 月 28 日
Hi all,
I have a big text (app 100k lines) right now and I wish to put every line as an array... could someone help?
201403 0.000 8.333 0.00 0.00
201403 0.000 8.333 0.00 0.04
So this is one of the lines of my text, and I wish to sort it with a loop as an array like
2014 03 0.000 8.333 0.00 0.00
2014 03 0.000 8.333 0.00 0.04
Can anybody help please?
Thanks!
  1 件のコメント
Geoff Hayes
Geoff Hayes 2014 年 10 月 27 日
Is all of your data numeric and does every line have five columns? If so, try using importdata, or check out Ways to Import Text Files for some ideas.

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

採用された回答

Siddharth Sundar
Siddharth Sundar 2014 年 10 月 28 日
Though I do not quite understand what you mean by 'sort it with a loop', a good place to start with would be the Import Tool. You should be able to bring in your data into MATLAB and then manipulate it as you please. It also lets you generate code that captures the workflow you followed in the Import Tool and makes it reusable.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by