Mid (string, start character, # of characters)
Problem: The NewYork file presents cost center, account, and account description as a continuous string, rather than as three strings. You want to separate the account strings from the cost center and account description strings.
Solution: In the Import Formats screen, assign the following script, which uses the Mid function, to the Expression field of the Account row. The script assigns the characters of the account strings (the characters from positions 7 to 10 of the string) to NY_ParseAccount.
-------------------------------------------------------------------- Function NY_ParseAccount [strField, strRecord] ‘------------------------------------------------------------------ ‘ FDM DataPump Import Script: ‘Created by: FDM_Admin ‘Date created: 2/28/2006 ‘------------------------------------------------------------------ NY_ParseAccount = Mid (strField, 7,4) End Function --------------------------------------------------------------------
Result: Account strings are separated from cost center and account description strings.