extract sp from raw