Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: PLEASE help to extract data of text file into variables
Date: Tue, 14 Oct 2008 20:55:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 59
Message-ID: <gd30v8$2un$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 1224017704 3031 172.30.248.37 (14 Oct 2008 20:55:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 14 Oct 2008 20:55:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1551459
Xref: news.mathworks.com comp.soft-sys.matlab:495174


Guys please I need help reading a text file like this. I have posted a couple questions regarding this but I dont find a solution for this. I have been trying to use fscanf, textscan, textread, txt2mat, etc and I cannot get them to work.

All my files are different but have the same structure. In this case it is a 3 machines (m) 6 jobs (n) as seen in the first two lines. Then it comes a matrix of jobs x machines (6x3) and then m number of matrices of (nxn). So basically the file structure can be known from the first two lines. Every matrix is separated by a blank line. This is an example of a file,

3
6

55 54 61
58 60 90
56 85 95
78 59 74 
92 83 65 
67 54 68
 
52 92 92 69 68 53 
90 84 63 91 59 71 
77 80 71 94 65 61 
54 54 60 86 54 99 
64 64 98 65 59 70 
87 59 61 61 96 65 

87 73 55 58 67 55 
84 97 51 62 98 89 
90 54 63 68 68 65 
52 77 81 74 85 54 
95 56 96 71 57 92 
70 58 59 95 66 78
 
71 58 81 69 86 76 
68 94 53 85 63 72 
52 68 67 58 57 92 
64 55 87 69 55 89
89 79 94 94 64 80 
78 63 90 58 82 59

65 83 95 77 91 84 
95 53 96 82 84 53 
79 50 98 72 80 66 
91 53 95 95 62 83 
76 91 59 87 94 63 
79 63 61 64 82 68 

58 78 62 83 93 95 
60 73 94 76 57 93 
98 86 59 97 60 89 
51 89 66 73 98 55 
61 86 73 77 58 57 
65 78 84 64 51 73 

76 79 57 69 85 93 
76 72 55 73 65 51 
98 71 60 54 79 75 
71 58 63 77 66 61 
61 77 91 71 60 62 
59 93 94 91 85 92 

Please help me to see how I can assign a variable to each matrix. I do not need you to write the whole code if you do not have the time or dont have it at hand, i just ask you to give a guide on how to do it! Thank you!

Sorry for posting a different thread but I did not get anywhere with the one before and it does not seem to be getting any more input!