var csvs = new Array();

var logs = new Array();

var cdata, ri, li, crecs, hdrline;

logs.push("BLOCKS="+that.result.getRowCount());

for (ri=0; ri<that.result.getRowCount(); ri++) {

  logs.push("FRAGID="+that.result.getCellValue(ri,1));

  cdata = that.result.getCellValue(ri,2);

  cdata = cdata.replace(/\r\n/g,"\n");

  cdata = cdata.replace(/\n\r/g,"\n");

  cdata = cdata.replace(/\r/g,"\n");

  crecs = cdata.split("\n");

  if (crecs[0].startsWith("RWTYP;RWPARENT")) hdrline = crecs.shift();

  for (li=0; li<crecs.length; li++) csvs.push(crecs[li].split(";"));

  logs.push("LINES="+crecs.length);

}

hdrline = hdrline || "RWTYP;RWPARENT;RWNAME;RWVALUE;RWDESC";

var mdns = hdrline.split(";");

var md = new Array();

for (ri=0; ri<mdns.length; ri++) md.push({name: mdns[ri]});

that.result = new aux.Result({resulttype: 'dbresult', rows: csvs, logs: logs, metaData: md});