How to Import unformatted text data?
조회 수: 5 (최근 30일)
이전 댓글 표시
Below I have attached a text file , how to read and separate the values
[
댓글 수: 4
채택된 답변
Matt Kindig
2012년 10월 4일
Hi Maddila,
This looks like a rather non-uniform format, so your best bet might be to read in the full file, and then separate it out using regexp. It looks like splitting by square brackets might do the trick. Something like this:
str = fileread('your/file/name'); %read in file in full
parts = regexp(str, '\[|\]', 'split'); %split by brackets
%then you can extract information from the individual split out sections.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Data Preparation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!