On Fri, May 25, 2012 at 1:22 PM, Rich Shepard <[email protected]> wrote:
> On Fri, 25 May 2012, Larry Brigman wrote:
>
>> You are trying to parse on fields when the fields have not been parsed
>> yet. add { } around your whole conditional list like:
>> {if ....... else ...... }
>> and move your semi-colons inside the { } for the conditions action.
>
>   Aha! I tried those one at a time, but not both together. Individually,
> they did nothing; together they taught me how to do this.
>
>   None of the examples I examined had both brackets around the if ... else
> if ... else range and semi-colons. Or, I just didn't see it all despite how
> closely I examined the code.
>
> Thanks, Larry!
>

Now that I had some sample code there are a couple of other things here.
The resulting output file won't have the trailing | character.
Your filters will also output blank lines with | characters.

Here is the resulting file output from your sample data using the
corrected filter:
--------------------------------
'A'|'1987-12-12'|'Ag'|-0.005
'A'|'1987-12-12'|'Al'|0.106
'A'|'1987-12-12'|'CO3'|-1.000
'A'|'1987-12-12'|'HCO3'|231.000
'A'|'1987-12-12'|'Alk_tot'|231.000
'A'|'1987-12-12'|'As'|0.011
'A'|'1987-12-12'|'Ba'|0.000
'A'|'1987-12-12'|'Be'|-0.002
'A'|'1987-12-12'|'Bi'|0.000
'A'|'1987-12-12'|'Ca'|100.000
'A'|'1987-12-12'|'Cd'|0.000
'A'|'1987-12-12'|'Cl'|1.430
'A'|'1987-12-12'|'Co'|0.000
'A'|'1987-12-12'|'Cr'|-0.006
'A'|'1987-12-12'|'Cu'|0.024
-------------------------------------
Only the first line had data changed from 0.000 to -0.005.
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to