Macros and Programming


CardboxForumsMacros and Programming > "How do I sort on the last word in a field?"

How do I sort on the last word in a field?

Posted By Post


9-Sep-2009 12:09

I imported an existing database with almost 1000 records. One field contains both first and last names. To sort on the last name only I have two options:
1 - split the field in a first name field and a last name field, then sort on the last name field
2 - remove the index for the first name, then sort on the indexed last name.
Both options require me to manually go through all 975 records to change the fields using option 1 or 2. This requires a LOT of time! Can anyone help me with a macro that will perform this task?


9-Sep-2009 12:38

You don't need a macro. Batch Edit can do it for you
- Select relevant records
- Goto record 1
- Keyboard: Ctrl-B
- Click your cursor into the desired field
Then keyboard commands:
- Ctrl-End
- Ctrl Left arrow
- Left arrow
- Shift-Ctrl-Home
- Ctrl
You see that all terms before last term are not indexed now.
Alright in THIS record? Then save record and batch.
1 minute...

© 2010 Cardbox Software Limited   Home