© Matti Mattila, CPFA, CISA, CIA

TexEdiMac: Change Text Lines to same [Fixed] Length

Previous item Next item Previous menu
Test Design
Picture 1
- In picture 1 a file (source file) is shown that will be used in demonstrating 'Change Lines to same Length'-functionality ('CheLinLen') of 'TexEdiMac' macro.
- The objective is to make a new file, where source file lines are equal in length [1].
Running the macro
- The easiest way to run the macro is pressing simultaneously Ctrl + Shift + 't'.
Picture 2
Picture 5
Picture 6
- At the beginning of the run you are shown the form in picture 2. Select 'Change Lines to same [Fixed] Length'.
- The macro shows a short description what it does (picture: [2]). Read the information, and [click 'Yes' to] in order to proceed.
Picture 3
Picture 4
- You will be asked to select a file to be edited (picture 3). Please, click "Yes" ('Kyllä' in picture 3 means 'Yes').
- We search 'test.txt' in folder 'ChaLinLen' and select it (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' [3].
- The macro tells you the path and file name of the resulting file (here: 'D:/ChaLinLen/test.tx9').
- The macro informs you about the count of lines and shows lenght of both the shortedt and longest source file line (picture 6). The macro suggests that all lines will be made as long as the line in the source file. Let's choose it. However, you can freely choose any other length in stead of it.
The new text file
- Result of the run is shown in picture 7. We can see all lines have the same lenght.
Picture 7

[1] When edited this way the file is easier to import into [older versions of] IDEA.
Picture 8
[2] Text (to the left) on "Guidance" worksheet of 'TexEdiMac.xls': what the macro does.
[3] The macro does not use special characters in an extension. Special characters are regarded here the following ASCII codes: 1-47; 58-64; 91-96; 123-255.