[PATCH openEuler-1.0-LTS 5/8] scripts/sortextable: Refactor the do_func() function