PURPOSE: To set a number in a desired form by arbitrarily defining the set form of the number from an input/output device by a user.
CONSTITUTION: A format information input/analysis processing part 16 inputs the format information of the number designated by the user from the format information input picture of an input/output device 18 and analyzes a variable part and a fixed character part in format information. A document input/ analysis processing part 14 reads the text of an input document 11 to be the object of automatic sampling, analyzes the text and extracts a spot to be sampled such as a part, chapter, clause, diagram number of list number, etc. A sampling processing part 15 samples the variable part in the format information to each extracted sampling spot, and a document edition/output part 17 integrates the sampled result into the document corresponding to the format information and outputs the result to an output document 12. Thus, the number such as the chapter number or the diagram number, etc., in the document is automatically set in the desired form for the user.