필터 지우기
필터 지우기

How to create a file and append a suffix?

조회 수: 1 (최근 30일)
L'O.G.
L'O.G. 2022년 3월 29일
댓글: Stephen23 2022년 3월 29일
How do you create a new file by appending a suffix like '.txt' or '.dat' etc. to an old file and then delete (to automate it - i.e. through MATLAB) the new file when you're done analyzing it? (I ask this because I have a large file that has a non-standard file type that I don't think I can open otherwise.)
  댓글 수: 1
Stephen23
Stephen23 2022년 3월 29일
"I ask this because I have a large file that has a non-standard file type that I don't think I can open otherwise"
How are you reading file? It is unlikely that you need to copy the file like that: e.g. all of READTABLE et al have the option of specifying the filetype, which would likely be much simpler than messing around with copying files.
Please upload a sample file by clicking the paperclip button. It does not need to be the complete file, just enough to be representative of the file format. Append .txt to the file extension (do not remove or change anything else).

댓글을 달려면 로그인하십시오.

답변 (1개)

Arif Hoq
Arif Hoq 2022년 3월 29일
% suppose you have a excel file with name "example"
A=readtable('example.xlsx')
% analyze what you want
% save the file
writetable('Your variable/output','example.xlsx')
delete('example.xlsx')
  댓글 수: 1
L'O.G.
L'O.G. 2022년 3월 29일
But how do I append a suffix without reading the file first? My problem is, as I mentioned, I have a non-standard file format. I can't read it without applying first a ".txt" suffix.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by