Covalent organic frameworks (COFs) allow elaborate manufacture of ordered one-dimensional channels in the crystal. We defined a superlattice of COFs by engineering channels with a persistent triangular shape and discrete pore size. We observed a size-recognition regime that is different from the characteristic adsorption of COFs, whereby pore windows and walls were cooperative so that triangular apertures sorted molecules of one-atom difference and notch nanogrooves confined them into single-file molecular chains. The recognition and confinement were accurately described by sensitive spectroscopy and femtosecond dynamic simulations. The resulting COFs enabled instantaneous separation of mixtures at ambient temperature and pressure. This study offers an approach to merge precise recognition, selective transport, and instant separation in synthetic 1D channels.