필터 지우기
필터 지우기

converting txt to xlsx

조회 수: 13 (최근 30일)
gmltn1212
gmltn1212 2020년 7월 16일
댓글: Tim Koopman 2020년 7월 16일
Hi I am trying to convert a textfile to xlsx. file
My textfile holds this information:
StudentName: James
School: University of Blah
Year: 2020
Grade: 3
Pin: 40
And I want to convert this to xlsx. file
*check the attached screenshot file*

채택된 답변

Tim Koopman
Tim Koopman 2020년 7월 16일
This will convert the full text file to .xlsx:
yourFileName = readcell('yourFileName.txt')
writecell(yourFileName,'yourFileName.xlsx')
If you only want to save the second column, like in your screenshot, use this:
yourFileName = readcell('yourFileName.txt')
writecell(yourFileName(:,2),'yourFileName.xlsx')
  댓글 수: 2
gmltn1212
gmltn1212 2020년 7월 16일
does readcell() function work on text files?
Tim Koopman
Tim Koopman 2020년 7월 16일
Yes it does

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by