Greetings All
I'm trying export time to a file in the format YYYYMMDDhhmmss but it doesn't concatenate YYYY MM DD hh mm ss when I use the pack object. I can export the data to a file but how do I concatenate everything together so it outputs as YYYYMMDDhhmmss with no spaces in-between?
Aloha Rick
if you just use $1 for something like 07, then it will cut off the leading zero (which in this case, you need)
so might be best just to split everything into individual floats, like:
[ 1 9 7 8 0 7 2 9 0 9 3 0 2 1 (
and then just feed that into a big compound message like
[ $1$2$3$4$5$6$7$8$9$10$11$12$13$14 (
that way you get all the zeroes as well
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-10-01 12:35, i go bananas wrote:
if you just use $1 for something like 07, then it will cut off the leading zero (which in this case, you need)
so might be best just to split everything into individual floats, like:
[ 1 9 7 8 0 7 2 9 0 9 3 0 2 1 (
or use [makefilename %02d] to generate a 2-character symbol with leading 0s
[1978 7 29 9 30 21( | [unpack 0 0 0 0 0 0] | | ... [makefilename %04d] [makefilename %02d] ... | | ... [unpack s s s s s s] | [symbol $1$2$3$4$5$6( |
mfasr IOhannes
Thanks for the info but two issues that pop up when I try this are
if I split everything out as floats. 2) when I pipe the messagebox [ $1$2$3$4$5$6$7$8$9$10$11$12$13$14 ] into the | add $1 | textfile
it just prints 0; can a messagebox be used as a variable in the add object for textfile if not what should I replace it with. Thanks again
PS I'm using pd 0.42.5 extended on ubuntu 10.04 64bit
Aloha
On Tue, Oct 2, 2012 at 12:35 AM, i go bananas hard.off@gmail.com wrote:
if you just use $1 for something like 07, then it will cut off the leading zero (which in this case, you need)
so might be best just to split everything into individual floats, like:
[ 1 9 7 8 0 7 2 9 0 9 3 0 2 1 (
and then just feed that into a big compound message like
[ $1$2$3$4$5$6$7$8$9$10$11$12$13$14 (
that way you get all the zeroes as well
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-10-01 13:23, Rick T wrote:
Thanks for the info but two issues that pop up when I try this are
- when I use zexy date and time object there's no option for
leading zeros
so you can hook the [makefilename %02d] directly to [date]/[time].
if I split everything out as floats. 2) when I pipe the messagebox [ $1$2$3$4$5$6$7$8$9$10$11$12$13$14 ] into the | add $1 | textfile
i'm a bit confused what exactly you mean here.
i'd suggest to use the "standard" ascii-rendering of Pd's graphical elements: [foo] <-- object-box with "foo" [bar( <-- message-box with "bar" [...\ <-- number/symbol-box | <-- connection line
so your patch should look something like:
[$1$2$3$4$5$6$7$8$9$10$11$12$13$14( | [add $1( | [textfile]
this basically does not work, because the first message-box (with all those dollars), will create a message with a _selector_ "19780729093021" and no atoms. now "$1" in [add $1( will get replaced by the 1st atom of the incoming message. since your message does not have any atoms, it will be replaced by "0" (and you should get an error on the Pd-console)
the proper way to fix this, is by providing an explicit selector, e.g. [symbol $1$2$3$4$5$6$7$8$9$10$11$12$13$14( (which will create a message with the selector "symbol" and one atom "19780729093021")
mcfgarsd IOhannes
On Mon, 2012-10-01 at 00:14 -1000, Rick T wrote:
Greetings All
I'm trying export time to a file in the format YYYYMMDDhhmmss but it doesn't concatenate YYYY MM DD hh mm ss when I use the pack object. I can export the data to a file but how do I concatenate everything together so it outputs as YYYYMMDDhhmmss with no spaces in-between?
You probably need to do that in two steps:
Make sure, that all numbers have the correct number of digits
glue everything together
Use [makefilename %02d] to create a two digit symbol (<- yeah, the output is a symbol!) with leading zeros from the incoming float. For the year you need [makefilename %04d] in order to create a four-digit symbol. You get the idea.
Use [pack s s s s s s] to put everything into a single list message. Then you get rid of the spaces with a message box like this: [symbol $1$2$3$4$5$6(
Roman
Thanks that made it work :-)
Aloha
On Tue, Oct 2, 2012 at 1:24 AM, Roman Haefeli reduzent@gmail.com wrote:
On Mon, 2012-10-01 at 00:14 -1000, Rick T wrote:
Greetings All
I'm trying export time to a file in the format YYYYMMDDhhmmss but it doesn't concatenate YYYY MM DD hh mm ss when I use the pack object. I can export the data to a file but how do I concatenate everything together so it outputs as YYYYMMDDhhmmss with no spaces in-between?
You probably need to do that in two steps:
Make sure, that all numbers have the correct number of digits
glue everything together
Use [makefilename %02d] to create a two digit symbol (<- yeah, the output is a symbol!) with leading zeros from the incoming float. For the year you need [makefilename %04d] in order to create a four-digit symbol. You get the idea.
Use [pack s s s s s s] to put everything into a single list message. Then you get rid of the spaces with a message box like this: [symbol $1$2$3$4$5$6(
Roman
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list