Write Data to txt file from Excel

1 view (last 30 days)
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 Comments
Rounak Saha Niloy
Rounak Saha Niloy on 17 Mar 2022
  1. Yes, numeric data.
  2. Read data into MATLAB and then MATLAB writes data - this should be the case.

Sign in to comment.

Accepted Answer

Arif Hoq
Arif Hoq on 17 Mar 2022
Edited: Arif Hoq on 17 Mar 2022
try this:
A=readtable('data.xlsx','ReadvariableName',false);
writetable(A,'myfile.txt')
or
B=readmatrix('data.xlsx');
writematrix(B,'myfile2.txt')
  2 Comments
Arif Hoq
Arif Hoq on 17 Mar 2022
Edited: Arif Hoq on 17 Mar 2022
jsut use this:
A=readtable('data.xlsx','ReadvariableName',false,'Range','D3:D10');
or
B=readmatrix('data.xlsx','Range','D3:D10');

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by