translating-a-character.rex

Pipelines v2.1

 

Needs updating, the new files only has 15 records now after i cut it down to a more reasonable size.

 

.....|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....10...

Home

     **** Top of file ****
   1
   2 /* The following pipeline reads the file: aldous.txt; builds a translate table and applies that
   3    table against each input record. The translate table converts each of the ASCII characters
   4    'a' through 'j' to the corresponding characters 'A' through 'J'. The example selectively converts
   5    the specified range of characters from lowercase to uppercase. */
   6
   7 Address Rxpipe
   8
   9 'pipe < &installdrive:\&installpath\examples\input\aldous.txt',
  10      '| take last 15',                        /* Select only the last 15 records. */
  11      '| translate 1-* a-j A-J',               /* Specify the table, and translate. */
  12      '| cons'                                 /* Display on the console. */
  13
  14 Say 'Hit Enter to close..'
  15 Parse Pull
  16
  17 Exit 0
     **** End of file ****
 

Console output

 
.....|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....10...
   1 oF onE, IF tHEy wErE to BE GooD AnD HAppy mEmBErs oF soCIEty, As possIBlE. For pArtIC-
   2 ulArs, As EvEryonE knows, mAkE For vIrtuE AnD HAppInEss; GEnErAlItIEs ArE IntEllECtuAlly
   3 nECEssAry EvIls. Not pHIlosopHErs But FrEt-sAwyErs AnD stAmp CollECtors ComposE tHE
   4 BACkBonE oF soCIEty.
   5
   6 "To-morrow," HE woulD ADD, smIlInG At tHEm wItH A slIGHtly mEnACInG GEnIAlIty, "you'll
   7 BE sEttlInG Down to sErIous work. You won't HAvE tImE For GEnErAlItIEs. MEAnwHIlE ..."
   8 MEAnwHIlE, It wAs A prIvIlEGE. StrAIGHt From tHE HorsE's moutH Into tHE notEBook. THE
   9 Boys sCrIBBlED lIkE mAD.
  10
  11 TAll AnD rAtHEr tHIn But uprIGHt, tHE DIrECtor ADvAnCED Into tHE room. HE HAD A lonG
  12 CHIn AnD BIG rAtHEr promInEnt tEEtH, Just CovErED, wHEn HE wAs not tAlkInG, By HIs Full,
  13 FlorIDly CurvED lIps. OlD, younG? THIrty?, FIFty? FIFty-FIvE? It wAs HArD to sAy. AnD
  14 AnyHow tHE quEstIon DIDn't ArIsE; In tHIs yEAr oF stABIlIty, A. F. 632, It DIDn't oCCur
  15 to you to Ask It.
  16 Hit Enter to close..