Extracting Beginning Characters

Problem: The account numbers of the Indiana_GL screen, which are in the first field of each line, include varying numbers of digits. However, the mapping associated with the file uses only four digits.

The image shows a comma-delimited GL file described in the text preceding the image.

Solution: In the Import Scripts screen, assign the following script to the Expression field of the Account row. The script assigns the first four digits of each account number (the first four digits on the left) to Parse_Account:

def Parse_Account (strfield, strrecord):
		return strField[:4]	

Result: The import file displays only the first four digits of each account number.