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
