dpb
Posts:
6,677
Registered:
6/7/07
|
|
Re: Extract numbers from table containing text and numbers
Posted:
Feb 5, 2013 10:43 AM
|
|
On 2/5/2013 8:50 AM, Bruno Luong wrote: ...
> I consider it is a relative easy task to write the wraparound code that > does fixed format, may be a fortran like. May be one of the fortran > users might be volunteer to do it and post in the FEX rather than > waiting for TMW to do it for you guys (I bet it will never happen).
Well, it is for the experienced (a relatively simple task, that is), but the question is "why do you have to do so?" instead of there being the facility in the base formatted i/o functions? Plus, the time taken for doing that could be used for other more useful things.
I have had in the past some mex files that did precisely that--pass FORMAT strings to Fortran to handle some i/o. Unfortunately, the source seems to have been lost on the machine at a former place of employment as I haven't been able to find it here. The question came up not very long ago w/ a poster who had the identical question regarding an input string similar to the example. It is conceptually quite simple; in practice as I recall it took some effort to make it general-enough to be of much generic use.
At this point in my life I'm not sure I'll ever have the ambition to actually do that much "real" coding again--I've simply lost the ambition/drive to write code at 2AM like a young'un and am too involved in the farming operation and other activities at the local level to have the time for more than just poking around at cssm for a little while in the mornings to sorta' halfway keep my hand in...
But, that TMW doesn't do it doesn't mean it's not a good idea to include in Matlab. :)
Since TMW has been kind enough to me recently to provide a license for R2012b for evaluation/comments, perhaps I will try to build a coherent set of enhancement requests, though...
It's just a shame that K&R didn't follow the clearly better path already laid out instead of having to reinvent a (slightly out-of-round) wheel and so we have to suffer for it...
--
|
|