The invention provides a shell-and-tube heat exchanger comprising a shell. Sealing heads are arranged at the two ends of the shell, pipe plates are arranged at the connection positions of the sealingheads and the shell, a heat exchange pipe is connected with the pipe plates at the two ends, a gas phase in gas-liquid two-phase flow is insoluble or poorly-soluble gas, in other words, the gas cannotbe dissolved in liquid in the heat exchange process, a separating device is arranged in the heat exchange pipe and is of a sheet-like structure, and the sheet-like structure is arranged on the crosssection of the heat exchange pipe; and the separating device is composed of square through holes and regular octagonal through holes, the side length of the square through holes is equal to the side length of the regular octagonal through holes, the four sides of each square through hole are the sides of four different regular octagonal through holes, and the four mutually-spaced sides of each regular octagonal through hole are the sides of four different square through holes. According to the heat exchanger with the separating device of the new structure, when the gas-liquid two-phase flow exists in the pipe, compared with the background art, heat transfer is further enhanced, vibration of the pipe is weakened, and the noise level is reduced.