If you notice that you often make the same sequence of actions with TextLab, you can combine this sequence of action in one. You can do this using the console application TextLabCmd, which comes with TextLab. This application can perform all text processing action which performs TextLab, but works in the command line promt window. This application is intended for writing batch files containing sequential calls TextLabCmd and other external commands for text processing.
For example, you need to combine the sequence of the following actions:
- Tabify;
- Trim Trailing Spaces;
- Align Comments.
You can do this by using the following .bat file, if it is connected to TextLab.
TextLabCmd.exe -action:Tabify -tabsize:4 | ^
TextLabCmd.exe -action:TrimTrailSpaces | ^
TextLabCmd.exe -action:AlignComments -texttype:2
Command line options of TextLabCmd correspinds to TextLab settings:
- -action:<Action Name>
- List names operations below. Mandatory option.
- -texttype:<Text Type Code>
- Text Type Codes:
1 - Natural Language,
2 - С-like syntax languages,
3 - Unix Shell-like syntax languages
4 - VB,
5 - SQL,
Default is - 1 (Natural Language);
- -textwidth:<Text Width>
- Maximum text width. Default is - 80;
- -usetab
- Switch of using tab character. By default tab character is using.
- -tabsize:<Tab size>
- Default - 4;
- -bullets:<Bullet List>
- Coma separated bullet character list. By default - "o,*,+,-,¤,·,v,<>,[]".
- -listmark:<Numbering Code>
- Numbering Codes:
1 - 1. 2. 3. ...
2 - 1) 2) 3) ...
3 - I. II. III. ...
4 - i. ii. iii. ...
5 - A. B. C. ...
6 - A) B) C) ...
7 - a. b. c. ...
8 - a) b) c) ...
9 - А. Б. В. ...
10 - А) Б) В) ...
11 - а. б. в. ...
12 - а) б) в) ...
By deault - "1. 2. 3. ...."
- -columns:<Column number>
- Used for table formatting. By default - 3;
- -keepleft</strong>
- Признак необходимости сохранения положения каждого абзаца,
По умолчанию при форматировании все абзацы выставляются получают одинаковый отступ от левого края текста.
- -nlistBtm</strong>
- Использется для форматирования много уровневых списков. Признак необходимости нумерации самых глубоко вложенных элементов списка.
По умолчанию самые глубоко вложенные элементы списка нумеруются.
- -cp:<Code Page Number>
- Code Page Number that is used for input/output stream coding.
By default - 1251.
Use the following names:
- Paragraph
AlignLeft, AlignRight, AlignCenter, Justify, JoinLinesInOne, DoubleLineSpace, JoinParagraphs,
- List
NumberedLines, BulletedLines, MultiNumberedLines, MultiBulletedLines, CleanLineBullets, SortLines, NumberedPgs, BulletedPgs, MultiNumberedPgs, MultiBulletedPgs, CleanPgsBullets,
- Table
Columns,
- Characters
AlterCase, UpperCase, Lowercase, CorrectKbLayout, Translit, BackTranslit
- Whitespaces
Tabify, Untabify, IncIndent, DecIndent, MoveRight, MoveLeft, Unalign, TrimTrailSpaces
- Programming
Comment, Uncomment, AlignComments, DeleteComments, OnlyComments
Utility takes input from stdin, return the result in stdout.
Below is an example of use:
TextLabCmd.exe -action:UpperCase < source.txt > target.txt