|
Baalzamon wrote:
> Ah sorry. I have another program (a) which stores parameters in
> tabulated form. However the program that does this hasn't forseen that
> some of the numbers in a field can be larger than the allowed size of
> the field. (Much like when you have a 8 digit number in a cell only big
> enough for say 5 digits). As a result it fills the field with stars
> like in the example shown previuosly. In other instances lets say the
> contents of two adjacent cells are 260 and 1000. Then the output should
> be [200 1000] however if like mentioned before one of the numbers is
> too large the result becomes [2001000] as such the fields are merged. In
> a previous m file i wrote this problem was somewhat solved as any rows
> that had merged cells also contained stars and these were discarded.
> Now, after some tinkering with the program (a), these are now 'reliable'
> data sets. So my previous method is no longer valid. Below are two
> examples of lines from my file
Well, I'd start w/ the beginning file and use the proper field width
since they are fixed width fields. That solves the problem of valid
data "merged" -- they _aren't_ merged, they just are each filling the field.
But, the case of overflow creates a problem because, I presume, it can
occur in any column on any given record. Therefore, I think you'll have
to first use fgetl() to read a line, find whether there is or isn't an
asterisk and parse each line based on that.
But, if it were at all possible, I'd fix (or cause to be fixed) the
original program to quit making useless data sets.
--
|