How to Import unformatted text data?

Below I have attached a text file , how to read and separate the values
[

댓글 수: 4

Jan
Jan 2012년 10월 4일
What are "the values" and which kind of output do you wnat? What have you tried so far and which explicite problems occurred?
Jan
Jan 2012년 10월 4일
편집: Jan 2012년 10월 4일
[FIRING PLATFORM SCENARIO]
SURFACE FRIGATE 1
[TORPEDO SCENARIO DETAILS]
Are you sure that these data are not concerned by the export restrictions of mass destruction weapons? I got troubles already when I've posted an 128-bit AES encryption in the FEX...
Would our assistence support killing of human in any nation for any reasons?
Matt Kindig
Matt Kindig 2012년 10월 4일
CAE is a well-known defense contractor. So, yeah, probably.
Maddila
Maddila 2012년 10월 5일
No ,,This is just reference text file,,i have to program it mr Jan Simon,,

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

 채택된 답변

Matt Kindig
Matt Kindig 2012년 10월 4일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Data Import and Export에 대해 자세히 알아보기

질문:

2012년 10월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by