This is the principle of how an oil refinery works. The oil is heated and it boils. The gases are collected against a cold plate and condensed to give a range of separate substances.