In any case at law, upon a party making affidavit that a particular book of accounts, or other writing or paper is important for him to have in the trial of his cause, he may procure from the clerk of the court in which the action is pending a subpoena duces tecum requiring any party to the action to appear before the court on a day named therein, and bring with him and produce before such court such book of accounts, or other writing or paper, as is specified in such process, in order that the same may be used as evidence on the trial of the action. And unless the person upon whom such process is served shall, at the time specified therein, produce what is so required, or show to the satisfaction of the court that he has not under his control such book, writing or paper, or unless, from an inspection or otherwise, the court is of opinion that the character of the book, writing or paper is such as should not be used as evidence on the trial of the action, the court may attach him and compel him to produce the same. It may also, if it see fit, set aside a plea of such person and give judgment against him by default, if he be a defendant, or, if he be a plaintiff, order his suit to be dismissed, with costs, or if he be claiming a debt before such court or commissioner, disallow such claim.