1 of 1 people found this helpful
You can use
Length (YourTable::YourField) to find the number of characters in a field.
Here's the description: Length
In your case do something like this in a script maybe:
Go To Record [First]
If [ Length (YourTable::Prefix) > 4
set field [ YourTable::JobTitle value: yourTable::Prefix]
set field [ YourTable::Prefix value: "" ] //clears out this field.
Go to Record [ Next. Exit after last ]
The number of characters (including spaces, line breaks, etc.) is counted using the Length() function.
So you could write a script to do what you want, but you might also do this one-time task manually using an appropriate Find and then "Replace Field Contents..."
To find records with more than 4 characters in a field, enter Find mode and then enter @@@@@* as your search string in that field. This will find five characters followed by any number of characters. Browse the records to see that it found the ones you needed and didn't include any lengthy prefixes, e.g. The Honorable. (If you discover patterns of lengthy prefixes that are being included in your search, you can exclude them by adding on additional search requests for those prefixes and make them Omit instead of Include.)
Then use Replace Field Contents... with a calculated result on the job title field. Make the calculation be just the prefix field so that it will copy the value from one field to the other on all of the records in the found set. When that is done you can now use Replace Field Contents... to make the prefix for these fields empty (since the value is now in the title field).
You could try doing a find for @@@@@* in the name prefix field which will find records with 5 or more characters in that field, and then click into the 'Job title' field and choose 'Replace Field Contents…' from the 'Records' menu. In the dialog that gets shown, choose to replace with a calculated result and make that calculation to be the name prefix field… Be very careful when doing this and make sure you make a backup first, just in case you make a mistake with the replace field contents step!
I am propper chuffed with that, thank you so much