Objective: To analyze syndrome differentiation and medication rules for leucorrhea in ancient books of traditional Chinese medicine (TCM) based on the “Chinese Medical Code” using the latent structure model. Methods: The formulations for leucorrhea were searched in the Chinese Medical Code (software), based on which an Excel sheet was created to conduct frequency analysis and construct a matrix of high-frequency medications. The high-frequency medications for leucorrhea were then analyzed using the Latent 5.0 software and a latent structure model. With SPSS Modeler and Latent 5.0 as the main analysis methods, Chinese medications with a frequency >1.00% were investigated using the latent structure model and association rules, and the medication rules in treating leucorrhea with TCM were dissected based on the data of frequency. Results: For 373 kinds of Chinese medicines retrieved from 236 TCM prescriptions, the total medication frequency was 2522. Chinese Angelica (Angelicae Sinensis Radix), White Peony Root (Paeoniae Radix Alba), Indian Buead Tuckahoe (Poria), Common Oyster Shell (Ostreae Concha), and Largehead Atractylodes Rhizome (Atractylodis Macrocephalae Rhizoma) were high-frequency medicines for leucorrhea. Tonic, heat-clearing, and qi-regulating medicines had a high frequency of usage. According to a formula-based analysis of the evidence, the main syndromes of leucorrhea included liver qi affecting the spleen pattern, damp heat accumulation pattern, liver qi stagnation pattern, liver-stomach disharmony pattern, yin deficiency of the liver and kidney pattern, and spleen deficiency with dampness pattern, which are generally in line with the etiology and pathogenesis of leucorrhea, namely pathogenic dampness as the detrimental factor together with spleen-kidney dysfunction. However, in ancient books, emphasis was laid out on the regulation of the liver. This study determined 31 association rules for treating leucorrhea, where the primary compatible medicines contained Chinese Angelica (Angelicae Sinensis Radix)-Nutgrass Galingale Rhizome (Cyperus rotundus), Chinese Angelica (Angelicae Sinensis Radix)-Szechwan Lovage Rhizome (Ligusticum chuanxiong Hort.), White Peony Root (Paeoniae Radix Alba)-Szechwan Lovage Rhizome (Ligusticum chuanxiong Hort.), White Peony Root (Paeoniae Radix Alba)-Adhesive Rehmannia Root Tuber (Rehmanniae Radix) and Tangerine Peel (Citri Reticulatae Pericarpium)-Ternate Pinellia (Rhizoma Pinelliae). Conclusion: The medication rules targeting leucorrhea in the Chinese Medical Code were mainly represented by the regulation of qi and blood, as well as the 3 internal organs—the kidney, spleen, and liver.