Write Data to txt file from Excel

2 ビュー (過去 30 日間)
Rounak Saha Niloy
Rounak Saha Niloy 2022 年 3 月 17 日
編集済み: Arif Hoq 2022 年 3 月 17 日
I have some data in cell D3:D10 in an excel file. I want to write these particular data in a txt file. How do I do that?
  2 件のコメント
Walter Roberson
Walter Roberson 2022 年 3 月 17 日
編集済み: Walter Roberson 2022 年 3 月 17 日
Is it numeric data?
Is it required that the MATLAB program instruct Excel to write the data, or would it instead be acceptable to read the data into MATLAB and have MATLAB write the data?
Rounak Saha Niloy
Rounak Saha Niloy 2022 年 3 月 17 日
  1. Yes, numeric data.
  2. Read data into MATLAB and then MATLAB writes data - this should be the case.

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

採用された回答

Arif Hoq
Arif Hoq 2022 年 3 月 17 日
編集済み: Arif Hoq 2022 年 3 月 17 日
try this:
A=readtable('data.xlsx','ReadvariableName',false);
writetable(A,'myfile.txt')
or
B=readmatrix('data.xlsx');
writematrix(B,'myfile2.txt')
  2 件のコメント
Rounak Saha Niloy
Rounak Saha Niloy 2022 年 3 月 17 日
I have data in various other cells of that excel file. I want to write data of only the mentioned cells i.e. D3:D10.
Arif Hoq
Arif Hoq 2022 年 3 月 17 日
編集済み: Arif Hoq 2022 年 3 月 17 日
jsut use this:
A=readtable('data.xlsx','ReadvariableName',false,'Range','D3:D10');
or
B=readmatrix('data.xlsx','Range','D3:D10');

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by