Subject: Re: [xsl] "sum" of "substring" From: Larry Kollar <kollar@xxxxxxxxxx> Date: Sat, 25 Oct 2003 20:20:15 -0400 |
My problem:
I have a flat text file that has to be transformed into a predetermined XML
file.
Example: TYPE1Field1AnotherField12.00YetAnotherField445.26FinalField TYPE1ABCDEFABCDEFGHIJKL45.00ABCDEFGHIJKLMNO123.45ABCDEFGHIJ TYPE2FieldAnother987.65Final
where the first 5 characters indicate which one of two record layouts it is.
I need to total up certain numeric values within the record of a specific
layouts.
For example, I want to total up the values that occupy positions 24 thru 28
from all records of "TYPE1".
MHO, this is really the realm of a flat-text processing program like awk or perl. You have a wonderful XSLT hammer, but you're trying to use it on a screw. Use awk to grind the threads off the screw & make it into a nail that you can pound on with XSLT. :-)
I need to total up certain numeric values within the record of a specific
layouts.
For example, I want to total up the values that occupy positions 24 thru 28
from all records of "TYPE1".
Is there any way of doing this?
An awk script could handle that too. You could create a <total> element containing the sum at the end.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: "sum" of "substring", Dimitre Novatchev | Thread | [xsl] Re: "sum" of "substring", Dimitre Novatchev |
[xsl] dynamic html table generation, Garvin Riensche | Date | [xsl] Can I print well-formed XML/H, Nathaniel Stoddard |
Month |