Among the remarkable variety of semiconducting nanomaterials that have been discovered over the past two decades, single-walled carbon nanotubes remain uniquely well suited for applications in high-performance electronics, sensors and other technologies. The most advanced opportunities demand the ability to form perfectly aligned, horizontal arrays of purely semiconducting, chemically pristine carbon nanotubes. Here, we present strategies that offer this capability. Nanoscale thermocapillary flows in thin-film organic coatings followed by reactive ion etching serve as highly efficient means for selectively removing metallic carbon nanotubes from electronically heterogeneous aligned arrays grown on quartz substrates. The low temperatures and unusual physics associated with this process enable robust, scalable operation, with clear potential for practical use. We carry out detailed experimental and theoretical studies to reveal all of the essential attributes of the underlying thermophysical phenomena. We demonstrate use of the purified arrays in transistors that achieve mobilities exceeding 1,000 cm(2) V(-1) s(-1) and on/off switching ratios of ∼10,000 with current outputs in the milliamp range. Simple logic gates built using such devices represent the first steps toward integration into more complex circuits.