Removing a block of records

Pipelines v1.6

 

.* Example by TenFiftyTwo(c).

Home

 
.* The following pipeline reads the file: startup.ini and removes the first [TCPIP] section.
.* The FROMLABEL stages are used to select the beginning and ending records of the section
.* that we want to remove.
 
pipe (endchar ?)
     < &installdrive:\&installpath\Examples\Input\Startup.ini .* Read the input file.
     | a: fromlabel casei() /[tcpip]/     .* Select records starting with the TCPIP label.
     | drop 1                             .* Discard the label record.
     | fromlabel reg /^\[/                .* Start reading records again from the next label.
     | b: faninany                        .* Combine the streams.
     | cons                               .* Display on the console.
     ?
     a:                                   
     | take *                             .* Unselected records from FROMLABEL stage.
     | b:                                 .* Route them back to main pipeline.