- Positional field recognition vs. field delimiters. location: InstallDir/Samples/TextConverter/Manual Mode/1 Well formed input/ project file: InstallDir/Samples/TextConverter/Manual Mode/1 Well formed input/1.3 Positional.ConverterX
Open "1.3 Positional.ConverterX" project file by pressing Open ( The input file does not have any field delimiters. Each field starts from a position that remains constant throughout the file. The Input dictionary is set up using the field delimiters and shows just a single input field, which will hold data for the entire input record. After the output dictionary is set up (field names, types and widths) you can implement the OnRecord context method to extract the appropriate (position based) input values for each output term see the script pane. To help gather the positional information, tabular input view shows the position for each character in the input text if the cursor is held over that character for more than a second: Using this information, you implement a custom conversion for each output field: DictOut.SellerServNo.value = Mid(DictIn.Field.value, 5, 6) Use the InitDate, InitNumeric utility functions to initialize dates and numbers from the text values. DictOut.NetYield.value = target.InitNumeric( Mid(DictIn.Field.value, 35, 5 ), 3 ) To reduce the amount of typing, drag and drop fields from the output dictionary into the Script editor: Each change in the script is immediatly reflected in the output preview, which make it easy to create a custom conversion quickly and without errors.
Go to Sample 2.1 for more training.
Go to 2.1 TagSearch for more training. Related SectionsSetting up a Conversion: Step-by-Step
|

