Make your first stop the envigourated pick: pipe (end \) literal |dup 1000|spec number 1|p: pick from after 1 == 1 count 99| hole\p:|cons
1 101 201 301 401 501 601 701 801 901 1001 Ready; T=0.01/0.01 05:15:31 j. 2009/12/22 Rob van der Heij <[email protected]> > On Tue, Dec 22, 2009 at 9:40 AM, DUGALEIX Michaël > <[email protected]> wrote: > > Hello all, > > > > I'd like to take a sample of a big "real" file (each line of the file > having > > the same structure) to test some programs, by putting in my sample only > the > > lines (for example) 1, 1001, 2001, 3001, ... > > > (1) something like "pipe < inputFile | spec 1-* 1 read read read ... read > | > > ..." which would get rid of the 999 lines I don't want > > (2) something like "pipe diskrand 1 1001 2001 ... | ..." > > Well, if you really only want 0.1% of the data, it's probably a bit > wasting resources to read the entire file and skip the remaining > records. Even when you can do that in an interesting way like this: > > | spec number 1.10 r 1-* n | pick 10 == ,1, | substr 11-* > > How about this? > > \ literal | dup 99 | spec number by 1000 1 | diskrand big file a | ... > > Sir Rob the Plumber >
