© Matti Mattila, CPFA, CISA, CIA

TexEdiMac: Examine a Text File

Next Item Previous menu
Test Design
Picture 1
- In picture 1 a file (source file) is shown that will be used in demonstrating 'Examine a Text File' functionality of 'TexEdiMac' macro (later renamed as 'TexEdi').
Running the macro
-The easiest way to run the macro is pressing simultaneously Ctrl + Shift + 't'.
- At the beginning of the run you are shown the form in picture 2. Select 'Examine a Text File'.
Picture 2
- The macro informs what it does (in picture 3) [1]. Read the information and proceed.
-
Click 'Yes' ('Kyllä') to proceed, when macro asks to select a file for examination (picture 4).
Picture 4 Picture 5
- In picture 5 we select "test.txt" [in folder 'ChaLinLen'].
- The macro informs what is the [csv] file, where results of the examination will be written to (picture 6). As a rule the [csv] file will be in the same folder as the source file.
Picture 6
- The macro tells some attributes of the source file. It asks a user to see [detailed] character frequency information in a file, path and name of which appear in the message (picture 7).
- After reading the information click 'OK', and there will be a message: 'Finished'.
Picture 7
Frequency Information Import (13.09.2010)
- Most convenient way to view frequnecy information is to do it in Excel.
- We import "test.csv" onto its new Excel worksheet with Excel's Text Import Wizard: "Data" - "Get external data" - "Import Text File" (File Type: "All Files")(Picture 8); browse until we find "testi.csv"; select it (Picture 9); and select "Import".
Picture 8 Picture 9
- Text Import Wizard shows at least three forms, when importing a text file. When importing 'test.csv',
(1) on the first form (Picture 9) select file type 'Delimited' (picture 10); and then click 'Next'.
(2) on the second form select separator 'Semicolon' and text qualifier 'Nothing' (in stead of "); then then click 'Ready'.
(3) when asked where to import the text, we decide toi import it to a new worksheet.
Picture 10
- The data area of the worksheet is so large (33 rows, 72 columns) that only upper left parts of it are shown in the picture 11.
Frequency Information Examination
- There is name of the source file on the first line of the worksheet, and information about empty lines on the last line.
- Column "A" tells the ASCII code of the character that is shown in column "B". In column "C" there is information how many times the character appears in the source file.
- In columns "1" to "72" there is count of appearance of the in respective postions (1-72).
- Afterward, we have set yellow background to cells, where there is the same character in same position on each line (picture 11). This is to visualize the following facts: each lines starts with "1"; there is "9878" on each line in positions 5-8; there is "0" each line in position 15; and there are only big letters in positions 11-13, and only numbers in positions 2-28 on each line; etc.
Picture 11

[1] Macro's message (read from certain cells of 'Guidance') and shown thereafter.
Picture 3: Text from 'Guidance' worksheet: what the macro does