Re: Repeated sequence
- To: mathgroup at smc.vnet.net
- Subject: [mg64003] Re: Repeated sequence
- From: Peter Pein <petsie at dordos.net>
- Date: Fri, 27 Jan 2006 05:13:14 -0500 (EST)
- References: <dr80a3$ph3$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
I've got another one:
Partition[Pick[Rest[#],Most[#],10|20]&/@list,2]
Cheers
Peter
Borut Levart schrieb:
> Dear users,
>
> I have a list of DXF Polylines data, and I would like to extract the
> coordinates {x,y}_i out of each sublist (code 10 followed by x1, 20 by
> y1, and again 10 by x2, and so forth), but the length of the 10-20 run
> is general. I've read about Repeated pattern, but still can't extract
> the whole run.
> I would like to solve this with patterns.
>
> list={{5,8 B,330,F,100,AcDbEntity,8,0,100,AcDbPolyline,90,2,70,0,43,0.,
> 10,12.1426,20,18.2932,10,10.3823,20,15.2443,0},{5,8 F,330,F,
> 100,AcDbEntity,8,0,100,AcDbPolyline,90,2,70,0,43,0.,10,
> 10.3823,20,15.2443,10,8.62206,20,12.1954,0},{
> 5,92,330,F,100,AcDbEntity,8,0,100,AcDbPolyline,90,2,70,0,43,0.,
> 10,8.62206,20,12.1954,10,12.1426,20,12.1954,0},{5,
> 93,330,F,100,AcDbEntity,8,0,100,AcDbPolyline,90,2,70,0,43,0.,
> 10,12.1426,20,12.1954,10,15.6631,20,12.1954,0},{5,
> 94,330,F,100,AcDbEntity,8,0,100,AcDbPolyline,90,2,70,0,43,0.,
> 10,15.6631,20,12.1954,10,13.9028,20,15.2443,0},{5,
> 95,330,F,100,AcDbEntity,8,0,100,AcDbPolyline,90,2,70,0,43,0.,
> 10,13.9028,20,15.2443,10,12.1426,20,18.2932,0},{5,
> B9,330,F,100,AcDbEntity,8,0,100,AcDbPolyline,90,14,70,0,43,0.,
> 10,3.7764,20,18.0222,10,6.87499,20,17.7511,10,3.42781,20,16.6671,
> 10,6.10034,20,16.0477,10,4.70598,20,15.5831,10,5.51936,20,15.0798,
> 10,4.47358,20,14.5377,
>
> 10,5.44189,20,13.686,10,4.62851,20,12.7181,10,5.44189,20,11.3631,10,
> 4.35739,20,10.0467,10,4.82217,20,9.0014,10,4.20246,20,
> 7.33662,10,5.79048,20,6.83332,0}}
>