Unfortunately, that's not directly supported. I think that currently you'd
have to first sort the records as follows:
TRDE,1,25,25000,.......
STLM,1,25,25001,.......
TRDE,2,35,35000,.......
STLM,2,35,35001,.......
TRDE,3,45,45000,.......
STLM,3,45,45001,.......
TRDE,4,55,55000,.......
STLM,4,55,55001,.......
Of course, you could do that in a custom record filter, by buffering all the
records, resorting them using java.util.Arrays.sort and an appropriate
java.util.Comparator implementation, and then passing them all down
writeRecord.
Regards,
Daniel
----- Original Message -----
From: "Sandhya" <sa...@la...>
To: <ser...@li...>
Sent: Monday, April 09, 2007 8:12 PM
Subject: [Servingxml-help] grouping of non-consecutive records
> Hi,
> In the below file, there are 4 trade rows followed by 4 settlement rows.
> I want to group them by their id which is the second field. The expected
> outout is below. groupBy groups consecutive records. Can we group
> non-consecutive records?
>
> TRDE,1,25,25000,.......
> TRDE,2,35,35000,.......
> TRDE,3,45,45000,.......
> TRDE,4,55,55000,.......
> STLM,1,25,25001,.......
> STLM,2,35,35001,.......
> STLM,3,45,45001,.......
> STLM,4,55,55001,.......
>
> <transactions>
> <transaction id = 1>
> <trade>
> <qty>25</qty>
> <amt>25000</amt>
> <trade>
> <settlement>
> <qty>25</qty>
> <amt>25001</amt>
> </settlement>
> </transaction>
> <transaction id = 2>
> <trade>
> <qty>35</qty>
> <amt>35000</amt>
> <trade>
> <settlement>
> <qty>35</qty>
> <amt>35001</amt>
> </settlement>
> </transaction>
> </transactions>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Servingxml-help mailing list
> Ser...@li...
> https://lists.sourceforge.net/lists/listinfo/servingxml-help
>
|