select-files-by-size-and-date.rex |
Pipelines v2.1 |
.....|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....10... |
**** Top of file ****
1
2 /* The following pipeline selects the first 20 files that are between 2K and 4K in size
3 that have a modified date of (yyyy/mm/dd) 2007/05/11 or later. */
4
5 Address Rxpipe
6
7 'pipe filelist noh drv=c subdir ext=txt', /* Generate the list of files. */
8 '| locate w1 >= 2048', /* Select only files of size >= 2K. */
9 '| locate w1 <= 4096', /* Select only files of size <= 4K. */
10 '| specs w1 1.10',
11 'w2 nw',
12 'w2 nw', /* Duplicate the date field. */
13 'w3-* nw',
14 '| change 12-19 \/\ \\', /* Remove '/'s from the duplicated date field. */
15 '| locate w2 >= 20070511', /* Select only files of date >= 2007/05/11. */
16 '| take 20', /* Select the first 20 records. */
17 '| specs w1 1.10 r w3-* nw', /* Discard the duplicated date field. */
18 '| console' /* Display on the console. */
19
20 Say 'Hit Enter to close..'
21 Parse Pull
22
23 Exit 0
**** End of file ****
|