How to Import unformatted text data?

6 次查看(过去 30 天)
Below I have attached a text file , how to read and separate the values
[
  4 个评论
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by