Adding a header record

Pipelines v1.6

 

.* Example by TenFiftyTwo(c).

Home

 
.* The following pipeline reads the input file: example.txt, and formats each paragraph so that,
.* without splitting words, each record is no longer than 60 characters. After every twelve records
.* a rule is inserted into the output.
 
pipe (endchar ? stagesep ~ comment //)
     < &installdrive:\&installpath\Examples\Input\example.txt // Read input file.
 
     // Call the Maxlength pipeline to format each paragraph to a maximum record length of 60.
     ~ call "&installdrive:\&installpath\Examples\Handle arguments\Maxlength" 60
 
     ~ a: progress 12                 // Rule line every 12 records.
     ~ b: faninany                    // Merge data and rule records.
     ~ cons                           // Display on the console.
     ?
     a:
     ~ literal /trigger/              // Trigger the write.
     // Header record.
     ~ specs
     /         1         2         3         4         5         6         7         8         9/ 1
     x0a n
     /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/ n
     x0a n
     /|--------+---------+---------+---------+---------+---------+---------+---------+---------|/ n
     ~ b: