Creating a line parser from an example text

Top  Previous  Next

User interface > Main menu > Menu: Help > Wizards > New project wizard > Creating a line parser from an example text

 

If a file consists of lines which all have the same structure - e.g. a log file -, you can create a complete parser for this file with the wizard described here.

 

WizardExampleLine_en

 

At first you have to copy a typical line into the edit field above the table. Then you have to enter the definitions of the tokens into the table, by which the line shall be analyzed. This input is very simple for literal expressions. There is the menu item in the pop-up menu, which appears after clicking with the right mouse button:  Insert the select text as a literal token. With this function a text that was selected with the mouse in the edit field can be inserted directly as a token into the table.

Otherwise the input of the values into the table works just like at the tables of other wizards.

 

If you choose the direct output for the actions on the next page of the wizard, you will get the following Chapter production, after you have finished the wizard:

 

INT     {{out << xState.copy(); }}

":"     {{out << xState.copy(); }}

INT     {{out << xState.copy(); }}

":"     {{out << xState.copy(); }}

INT     {{out << xState.copy(); }}

INT     {{out << xState.copy(); }}

"."     {{out << xState.copy(); }}

INT     {{out << xState.copy(); }}

"."     {{out << xState.copy(); }}

INT     {{out << xState.copy(); }}

"-"     {{out << xState.copy(); }}

"error"     {{out << xState.copy(); }}

":"     {{out << xState.copy(); }}

SKIP     {{out << xState.copy(); }}

EOL

 

This production consists of the tokens of the table in the order as they are retrieved from the example text. Text parts that aren't recognized by the tokens of the table will be recognized with the SKIP token.

 

 



This page belongs to the TextTransformer Documentation

Home  Content  German