Dynamically filling up fields of a node in Drupal
Here is my way of doing it:


Create a Computed Field to manipulate the substring (Last Name) and store it as a field



  Computed Field is a very powerful field module that lets you add a
  custom "computed fields" to your content types. These computed fields
  are populated with values that you define via PHP code.



Use Computed Field Tools to bulk update the value for the existing nodes



  The Computed Field module only updates its computed values on saves or
  on load (if no computed value is computed yet). This is not optimal
  when using computed values in lists etc., or if you should wish to
  change the logic in the computed field.



Use this Computed Field as a sort criteria in Views.