|
© Matti Mattila, CPFA, CISA, CIA |
TexEdiMac: Remove Carrige Return (CR) |
|
| Test Design
|
 |
| Picture 1 |
|
|
| - |
In picture 1 a file is shown (source file) that will be used in demonstrating
'Remove Carrige Return (CR)'-functionality ('RemCarRet') of 'TexEdiMac'
(later renamed as 'TexEdi') macro.
|
| - |
Normally there is CR only in the end of a text chapter, not on each line.
The objective is to remove extra CRs - so the text is easier to edit e.g. in MS Word.
|
|
| Start running the macro
|
|
 |
| Picture 2 |
 |
| Picture 5 |
|
|
| - |
The easiest way to run the macro is pressing simultaneously Ctrl + Shift + 't'.
|
| - |
At the beginning of the run the macro shows the user the form in picture 2.
Select 'Remove Carrige Return (CR)' on it.
|
| - |
|
You will see information what the macro does (picture: 2a [1]).
Read the it, and proceed, and you will be asked to select a file
where to remove carrige returns.
Please, click 'Yes' ('Kyllä' = 'Yes' in picture 3).
|
 | |
Picture 3 |
|
|
| - |
|
You will be asked to select the text file, where to remove carrige returns.
We browse in order to find the source file,
which is 'test.txt' in this case.
The file is located in a folder 'RemCarRet' (picture 4).
We select the file.
|
 | |
Picture 4 |
|
|
| - |
The macro suggests a name to the new file: the body of the name of the source file,
with a bit different extension ('tx9 in stead on 'txt' in the example).
On the form (picture 5), where the file name was suggested,
you can change the extension of the [resulting] new file,
if you do not want it to be 'tx9'.
You do not need to write anything in the box 'File extension is stead of 'tx9''
when you decide to use extension 'tx9' [2].
|
| - |
The macro will inform, what will be the path and name of the resulting file
(not shown in pictures; it would be: 'D:/RemCarRet/test.tx9').
|
| - |
|
The macro gives a message telling the count of lines and the shortest and the longest
line of the source file (picture 6).
The message is delivered in a dialog, where to decide,
how short a source file line should be that CR would be left in it.
Here we use the default value (1) [3].
|
 |
| Picture 6 |
|
|
| The new text files
|
| - |
Result of the run is shown in picture 7 (Word wrapped in Notepad).
Carrige returns were succesfully removed.
|
 | |
Picture 7 |
|
 | |
Picture 8 |
|
| - |
Let's also test option 'Don't remove CR when line is shorter than: 15' (picture 6).
|
| - |
The text file that resulted from that run is shown in picture 8.
This text looks even better than that shown in picture 7.
In the text one identifies text chapters easily. |
|
|