Collinear acoustooptic (AO) switches have a feature of wavelength-selective switching for wavelength-division-multiplex (WDM) signals. This feature can be used for photonic packet routing in a WDM photonic network. In this paper, application of the collinear AO switches to a label recognition processor in a photonic routing system is investigated. The optical label uses optical codes which are encoded in the spectral domain. The collinear AO switch is considered to be useful for label recognition by using multiple wavelength switching with multiple frequency rf control signals. The switched and unswitched optical signals are processed with a balanced photodetector. A numerical example for the code recognition is presented.