We demonstrate that a high-intensity electron beam can be applied to create holes, gaps, and other patterns of atomic and nanometer dimensions on a single nanowire, to weld individual nanowires to form metal-metal or metal-semiconductor junctions, and to remove the oxide shell from a crystalline nanowire. In single-crystalline Si nanowires, the beam induces instant local vaporization and local amorphization. In metallic Au, Ag, Cu, and Sn nanowires, the beam induces rapid local surface melting and enhanced surface diffusion, in addition to local vaporization. These studies open up a novel approach for patterning and connecting nanomaterials in devices and circuits at the nanometer scale.