I've got a situation where I need to sort data from an XML file into either an array or a flat text file, so that I can perform operations on the data after that. It is important that the result calculations be done in a specific order, sometimes based on a repeating attribute that is not always present (when the attribute is present, I need to use it, otherwise, I use the value I've saved from the prior day). I need to do this job in as small a package as possible, because I don't want to require my customers to, in the end, need more than Excel and this VB executable that I want to build in Visual Basic. Keep in mind that the actual xml file will be much larger than Excel can handle; thus, the VB program to arrange the data before the calcs are done. From the sample file, assume that I want to end up with a single line for each "DataMessage" and that I wish to sort the data by Business Date, Location, Department, and Type. Note that Type="4" is not always present. When it is present, I want to use it. If creating a formatted file, I want a fixed amount of blank space where it would have been, if creating a text file. The question here is simply: how do I create the formatted text from the xml file, without requiring XSLT, etc?
Start Free Trial