Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
conversion .txt to .xls
조회 수: 1 (최근 30일)
이전 댓글 표시
hello, please, how can I convert a txt file to an Excel file
댓글 수: 3
답변 (1개)
Walter Roberson
2016년 4월 25일
Depending on the format of the text file, there are different ways of reading it. Sometimes it is enough to load() the file. Sometimes you need textscan(). Sometimes you need to do a log of work with parsing it. Try the import wizard; if it is able to handle the file then it can generate code for you.
If you end up with a numeric matrix, use num2cell() to convert it to cell array.
When you have a cell array, use xlswrite() to save it as xls file.
Note: if you are running on OS-X or Linux, or on MS Windows without Excel installed, then use the File Exchange contribution xlwrite() instead of xlswrite()
댓글 수: 7
Walter Roberson
2016년 4월 28일
I looked at your sample file with an editor. The difficulty of reading it in is going to depend upon exactly what data you want to extract out and into what variables. The difficulty is greatly increased if the "TOTAL =" data has to be extracted into the same variable as what it is being totaled.
Please show a sample output, indicating which values need to end up in which variables.
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!