extract esort file function