load TXT file into column vectors with different types of data
이전 댓글 표시
Hello,
I am trying to read some columns from a text file into matlab. I want colum "Serial Number" as strings 'because I don't want the serial number cut off) and column "Creation date" as a Matlab recognized date. I tried dlmread, textscan, converting it to CSV and use csvread, but nothing worked correctly. What should I do to read that data?
"REGID";"Line";"Machine";"Previous Operation";"Serial Number";"Signal Name";"Signal Value";"Creation date"
"594093484";"xxxx";"xxxx";"10";"051805140904122954";"xxxx";"811";"4/09/2014 12:25:38"
"594095082";"xxxx";"xxxx";"10";"051805140904123524";"xxxx";"1000";"4/09/2014 12:31:06"
답변 (1개)
Orion
2014년 10월 20일
0 개 추천
Use the Import wizard tool (right click on your text file in the Current folder, then import data).
I created a text file

and then generate a sciprt with the import wizard, see the mfile attached.
you juste need to specify if you want to import your data as text or as number.
카테고리
도움말 센터 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!