Prev: AM
Next: Slider of an edit box
From: james on 21 Jun 2010 04:15 I have a text file 'file1.txt' with text data as follows: headerdata headerdata date, time, #, val1, val2, val3, val4 12-28-2009, 13:12:12, 1, .2349, .2435, 54, .1 12-28-2009, 13:12:32, 1, .3432, .0235, 33, .4 12-28-2009, 13:12:34, 1, .5435, .0456, 67, .2 12-28-2009, 13:12:36, 4, .4545, .0001, 0 12-28-2009, 13:12:46, 1, .4535, .0334, 55, .5 12-28-2009, 13:12:48, 1, .5345, .1435, 69, .6 12-28-2009, 13:12:49, 1, .4567, .0667, 14, .7 12-28-2009, 13:12:51, 3, .7545, .0012, 0, 0, 0, 0 12-28-2009, 13:12:54, 1, .5674, .1547, 23, .8 The column labeled # corresponds to the number of the data I need. Any value in column labeled '#' that has a 1 is the data that I need. What I need to do is read this data from the text file into matlab and extract only the rows that have a 1 in column 3. (what makes this harder is some of the invalid data rows have more or less than 7 columns. The data above is just used for an example of a segment of my data. The real data is 20,000 rows long. Help is much appreciated.
From: dpb on 21 Jun 2010 08:45 james wrote: > I have a text file 'file1.txt' with text data as follows: > > headerdata > headerdata > date, time, #, val1, val2, val3, val4 > 12-28-2009, 13:12:12, 1, .2349, .2435, 54, .1 > 12-28-2009, 13:12:32, 1, .3432, .0235, 33, .4 > 12-28-2009, 13:12:34, 1, .5435, .0456, 67, .2 > 12-28-2009, 13:12:36, 4, .4545, .0001, 0 > 12-28-2009, 13:12:46, 1, .4535, .0334, 55, .5 > 12-28-2009, 13:12:48, 1, .5345, .1435, 69, .6 > 12-28-2009, 13:12:49, 1, .4567, .0667, 14, .7 > 12-28-2009, 13:12:51, 3, .7545, .0012, 0, 0, 0, 0 > 12-28-2009, 13:12:54, 1, .5674, .1547, 23, .8 > > The column labeled # corresponds to the number of the data I need. Any value in column labeled '#' that has a 1 is the data that I need. > What I need to do is read this data from the text file into matlab and extract only the rows that have a 1 in column 3. (what makes this harder is some of the invalid data rows have more or less than 7 columns. The data above is just used for an example of a segment of my data. The real data is 20,000 rows long. Search the forum for a posting of subject "textread" and look at the response to the subthread from arnold answered by us just within the last couple of days...probably about Friday iirc... --
|
Pages: 1 Prev: AM Next: Slider of an edit box |