Regexp Sprintf - Splitting up a symbol and keeping leading zeros
I'm hoping this will be a breeze for one of you regexp experts. I've got a symbol such as this:
015088_20140220_093000_000
It's from a filename and those are dates and times in there. I need to split it up into symbols at the underscores and keep the leading zeros (so 093000 is the time 09:30:00). I've got close with a spattering of stuff from the forum, but not there yet. And all the filenames have the same number of characters, so it is ok to slice by counting through, not just detecting underscores.
Help appreciated!
As you know the length of your fields you could use this (note that you don't need regexp to split a symbol):
Thanks Patrick, that does the job.
I had discovered the fromsymbol method, but this always removed the leading zero. Your sprintF stuff seems to add that back in, is that actually what's happening?
what happens is that you normally first needed to convert the numbers to symbols, then concatenate the leading zeros, and then build the list.
in the case of "symout" dr. sprintf is friendly enough to do that for you in one go though.