[npm] pTTL – Text Transform Language


Manual
[TRANSFORMER]

Thing to Know:

  • This is where you put pTTL (Text Transform Language) commands
  • Press “TRANSFORM” to format contents in the based textbox based on given commands here
  • Commands are processed line by line.
  • If you make mistake, you can redo by using Esc on the main textbox
  • A sequence of formatting steps can be saved as “Formatter.” You can choose a formatter from a select box, and press “Insert” to paste content into the cursor point. You can click “Explore” to go to the storage folder.

 

Basic Terms

string: a text
number: an integer

 

pTTL Commands

Operation Command (pTTL cmd) Description
Replace REPLACE [old string] WITH [new string] 
or REPLACE [old string] BY [new string]
Replace strings in a given input
Add ADD PREFIX [string] For each line, add a given string at the beginning
  ADD SUFFIX [string] For each line, add a given string at the end
Crop CROP AFTER FIRST [string] For each line, keep only contents after a given string (if > 1, remove from the first)
  CROP BEFORE LAST [string] For each line, keep only contents after a given string (if > 1, remove from the last)
  CROP FROM FIRST [string] For each line, keep only contents starting the given string (if > 1, remove from the first)
  CROP UNTIL LAST [string] For each line, keep only contents until the given string (if > 1, remove from the last)
Remove REMOVE BETWEEN [string1] AND [string2] Remove contents between 2 given strings on all parts.
e.g., removing all reference [..], removing all parentheses
Incrementing number #toN FROM [number] Increment One-by-One
e.g., given # = 1, “Hello# World#, How# are# You#” → “Hello1 World2, How3 are4 You5”
  #toN-L FROM [number] Increment By Lines
Similar to the above, but the number reset for each line.
Screen lines SCREEN REMOVE [string] Make lines with a given string blank
e.g., remove comments // in source code in programming
  SCREEN KEEP [string] Keep only lines with [string]
Skip some lines #SKIP GET [number] SKIP [number] For example, given 1 and 2 >> keep line # 1, 4, 7, …. remove 2,3,5,6,…
Sort line SORT Sort lines in alphabetical order
Sort line SORT DESC Sort lines in descending alphabetical order
Sort line SORT NUM Sort line in numerical order (extracts the numeric part from each line)
Sort line SORT NUM DESC
Sort line in descending numerical order
Sort line SORT REVERSE Sort lines in an opposite direction
Sort line SORT RANDOM
Sort lines randomly
     
     

 
 

Basic: basic formatting

  • Format commands: no need to put variable.

Char: use special character, such as [Tab] and new [NewLine]

 

 

Right bottom is wrapped text, for reading

 

Don`t copy text!