Forums > MaxMSP

removing commas


dnz
October 7, 2010 | 1:58 pm

hi there,

i was looking around but haven’t found anything that helps me to do this.

i have a long list of number with commas. i would want to sum all these values together, but my zl sum doesn’t accept commas. could someone guide me to the objects that i can cut and paste from a text program, into textedit (max obejct) to remove commas and then gives me the output of the sum.

any advice?

best


October 7, 2010 | 3:29 pm

Maybe like this?

– Pasted Max Patch, click to expand. –

Beware: if the list if really long, you may have to change the maximum list length in the zl objects.

p


October 7, 2010 | 3:36 pm

I’m at work, so I can’t check Patrick’s suggestion (he may be saying the same thing), but I’ve done some things with [atoi] into [zl filter] into [itoa] to remove spaces and other characters from messages. You just need to figure out what a comma is as an integer and then make that the filtered number.


October 7, 2010 | 9:57 pm

Or use [accum]?



dnz
October 8, 2010 | 9:08 am

hi!

thanks for the tip and patch. yes i forgot about itoa and atoi. yes accum works as well. thanks for the advice.

have a nice day.

best

d


Viewing 5 posts - 1 through 5 (of 5 total)