removing-trailing-blank-records-2.rex |
Pipelines v2.1 |
.....|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....10... |
**** Top of file ****
1
2 /* The following pipeline reads the file: winston.txt and removes any trailing blank records.
3 The pipeline uses two sort stages, the first; to reverse the entire file and the second, to
4 reorder the file once the leading blank records have been discarded. */
5
6 Address Rxpipe
7
8 'pipe < &installdrive:\&installpath\examples\input\winston.txt',
9 '| strip trailing', /* Strip off whitespace. */
10 '| specs recno 1 1-* n', /* Insert record number in column 1. */
11 '| sort 1-10 d', /* Sort records in descending order. */
12 '| fromlabel zone(11-*) pattern /?*/', /* Discard blank records. */
13 '| sort 1-10', /* Sort records back into ascending order. */
14 '| specs 11-* 1', /* Remove the column number. */
15 '| cons' /* Display on the console. */
16
17 Say 'Hit Enter to close..'
18 Parse Pull
19
20 Exit 0
**** End of file ****
|