Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: How to extract data out of a text file
Date: Mon, 13 Oct 2008 19:49:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <gd08nd$dsr$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1223927341 14235 172.30.248.37 (13 Oct 2008 19:49:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 13 Oct 2008 19:49:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1551459
Xref: news.mathworks.com comp.soft-sys.matlab:494948


Hey guys, 
I have .txt files that have the following structure and they all are different.

12
120

81 79 85 97 91 75 60 98 79 56 91 82
...
..
.
74 74 64 86 90 59 98 74 53 56 81 58 
50 90 76 68 53 57 60 73 72 62 99 55

69 74 75 62 76 55 67 55 78 96 69 79 69 97 53 59 72 ... 56
...
..
.
89 78 91 72 59 52 92 96 95 95 74 98 99 68 55 69 66 ... 76

So let me explain what this means. First the 12 and 120 means 12 machines (m) and 120 jobs (n). I want to be able to save this as a variable.

Then the next block shows a number of jobs times number of machines matrix which I also want to save as a different variable.

After that there are m blocks of data (12 in this case) with a matrix of nxn. I want to be able to save each of these blocks in a variable each.

All my files will have a different number of machines and jobs so I want MATLAB to be able to read this automatically.

Thank you so much for ANY help that is given! I appreciate your time responding to this!