Section 12. If a person indicted for a felony is acquitted by the verdict of part of the crime charged, and is convicted of the residue, such verdict may be received and recorded by the court, and thereupon the defendant shall be adjudged guilty of the crime, if any, which appears to the court to be substantially charged by the residue of the indictment, and shall be sentenced and punished accordingly.