Re: How to turn a very long list into smaller lists
Dnia 30.05.2008 Mel <MelHeravi@xxxxxxxxx> napisał/a:
I have a list that is very long and I need to break it into smaller
lists of say 50 elements (the original list is a muliple of 50.
An example operating much shorter lists - you'll have to expand it a little
to reach the needed sizes:
#v+
set ii 0
foreach {a b c} {1 2 3 4 5 6 7 8 9} {
set ::list$ii [list $a $b $c]
puts [set ::list$ii]
}
1 2 3
4 5 6
7 8 9
#v-
That "puts", of course, is just for "visual effects".
--
ZB
.
Relevant Pages
- Re: Thoughts about the controversial {expand} feature
... more regular TCL command methods for most purposes anyhow. ... The whole {expand} concept, as I ... It's returning a string. ... I'm only guessing here, but if basically concatenates lists, ... (comp.lang.tcl) - Re: Thoughts about the controversial {expand} feature
... something to do with lists. ... what i miss with the expand feature is something like the reserved ... Those [foreach ... ... command for collection. ... (comp.lang.tcl) - Re: How export all mailbox-enabled users from the GAL using Outlook?
... lists in your Exchange environment. ... User composes a message in Outlook to that DL. ... User clicks the + to the left of the DL name to expand it. ... (microsoft.public.outlook) - Re: Wordpress Javascript Index Loop
... should expand at the bottom of the post under the icon. ... lists 10 posts, and it will only work on the first post. ... Funny that "solution" exactly addresses the problem David Dorward ... and for the matter for more info: ... (alt.html) - Re: Wordpress Javascript Index Loop
... should expand at the bottom of the post under the icon. ... lists 10 posts, and it will only work on the first post. ... and for the matter for more info: ... (alt.html) |
|