removing commas

Oct 7, 2010 at 1:58pm

removing commas

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

#52627
Oct 7, 2010 at 3:29pm

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

#189215
Oct 7, 2010 at 3:36pm

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.

#189216
Oct 7, 2010 at 9:57pm

Or use [accum]?

#189217
Oct 8, 2010 at 9:08am

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

#189218

You must be logged in to reply to this topic.