Today I finished my program for combining data from different files. There will be three different files at the end of a day. A text file with lines and tab separated data containing all the data recorded by the Suunto watch. A gpx file that contains GPS data in xml format. And a text file with lines and tab separated data which holds time and activity data.
I placed myself for the daunting task of combining these different files and formats into one tab separated text file. As Flash can’t output a text file I chose Processing for the job. It appeared the capabilities to work with strings are rather limited compared to ActionScript or PHP. But they do have a very convenient XML element class. It was actually the first time I worked with an XML file in this way (that is extracting attributes from an XML node). The loadStrings function is very handy for loading external data and putting it into an array at the same time. In one big loop I cycle through all the files, add a concatenated line at the end of every loop. The result is a tidy text file with only the necessary data in a structured format.
A day well spend 🙂
Wellicht interessant (en wellicht ook al bekend): John Resig, de man achter jQuery, heeft Processing geport naar JavaScript, waardoor het mogelijk wordt om Processing direct in de browser te gebruiken.
Zie:
http://ejohn.org/blog/processingjs/
http://ejohn.org/blog/processingjs-aftermath/
http://ejohn.org/apps/processing.js/examples/basic/
Hi Sander,
Thanks for pointing that out! I wasn’t aware. Could be very useful in the future.
For now I think I’ll stick to Flash for online apps, but I’m sure that doesn’t surprise you 😉 I think the poor browser support (though understandable) is a drawback at this time. But I’ve heared and experienced that working with bitmaps is very slow in Flash and a lot faster in Processing. So that might be a good reason to try it out some day.