Reading a file backwards

Pipelines v1.6

 

.* Example by TenFiftyTwo(c).

Home

 
.* The following pipeline illustrates the most efficient way to select records that you know
.* lie toward the end of a large input file. By reading the file in reverse record order; the
.* target records can be located without unnecessarily traversing a significant portion of
.* the file.
 
.* This approach may be of particular use when extracting data from large 'log-type' files.
 
pipe < rev &installdrive:\&installpath\Examples\Input\NYSE-Tick.txt
     | inside zone(w2) /134700/ /134200/  .* Select the block of records.
     | buffer rev                         .* Reverse the records.
     | cons                               .* Display the records on the console.