Re: one line data from text file , Where the end position is unknown
- From: Walter Roberson <roberson@xxxxxxxxxxxx>
- Date: Sun, 16 May 2010 13:09:21 -0500
I have to read a textfile either using textread or textscan to read columns of a particular row of data, where the number of columns vary with each file. I've been able to start at that particular row , but how should i make matlab stop at the end of that row?.
That is not at all easy in general, not unless you know exactly how wide that column should be. If you do not know how wide the column should be, then chances are strong that you will need to read up to and including the character(s) that signal the end of line, which would leave you positioned at the beginning of the next line rather than at the end of the current one.
Chances are, though, that the beginning of the line is where you want to end up, unless you are trying to write more data on to the end of the line -- but if _that_ is what you are trying to do, you are unlikely to be able to do it (writing into the middle of a text file is quite tricky to get right, and I advise against it. Writing into the middle of a binary file is relatively easier, but still advised against in under ordinary circumstances.)
- Prev by Date: Re: Plot line between two points on ellipsoid
- Next by Date: Re: Plot line between two points on ellipsoid
- Previous by thread: Re: one line data from text file , Where the end position is unknown
- Next by thread: spdiags()