[javascript-dev] Tasks and String manipulations
volker böhm
vboehm at gmx.ch
Fri Mar 14 05:26:22 MDT 2008
- Previous message: [javascript-dev] Tasks and String manipulations
- Next message: [javascript-dev] Tasks and String manipulations
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 14 Mar 2008, at 11:24, Garth Paine wrote:
>
> I am reading out of a text file recorded using the Max Text object
> so it
> looks like
>
> 0, 110 9 220 218;
> 1, 110 9 218 218;
> 2, 110 9 218 218;
> 3, 110 9 218 218;
> 4, 110 9 218 218;
> 5, 110 14 218 218;
> 6, 110 9 218 216;
> 7, 110 9 218 220;
> 8, 110 4 220 220;
> 9, 110 4 220 220;
> 10, 110 4 220 220;
>
>
> I want to isolate each incoming integer and send it out a different
> output
>
> I looked at using regular expressions
>
> re = /\(?\d{4}\)?([,])\d{2}\1\d{2}\1\d{2}\1\d{2}/;
maybe i miss your point here. but if your data files look like this
(coll format), it's much easier doing it in max using the coll
object, a counter and a cycle object. trying to look at the text
lines as strings in javascript and squeezing out the integers is more
complex than it has to be in this case, imo. the format parsing is
done by the coll object.
you could try something like this:
#P window setfont "Sans Serif" 9.;
#P number 356 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 320 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 284 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 248 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 212 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 176 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 140 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 104 224 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 104 195 265 196617 cycle 8 1;
#P toggle 104 75 19 0;
#N counter 0 10;
#X flags 0 0;
#P newobj 104 137 68 196617 counter 0 10;
#P newex 104 101 58 196617 metro 200;
#N coll ;
#T flags 1 0;
#T 0 110 9 220 218;
#T 1 110 9 218 218;
#T 2 110 9 218 218;
#T 3 110 9 218 218;
#T 4 110 9 218 218;
#T 5 110 14 218 218;
#T 6 110 9 218 216;
#T 7 110 9 218 220;
#T 8 110 4 220 220;
#T 9 110 4 220 220;
#T 10 110 4 220 220;
#P newobj 104 165 53 196617 coll;
#P connect 1 0 2 0;
#P connect 3 0 1 0;
#P connect 0 0 4 0;
#P connect 2 0 0 0;
#P connect 4 0 5 0;
#P connect 4 1 6 0;
#P connect 4 2 7 0;
#P connect 4 3 8 0;
#P connect 4 4 9 0;
#P connect 4 5 10 0;
#P connect 4 6 11 0;
#P connect 4 7 12 0;
#P window clipboard copycount 13;
- Previous message: [javascript-dev] Tasks and String manipulations
- Next message: [javascript-dev] Tasks and String manipulations
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
