A class of data-driven control methods has recently emerged based on Willems' fundamental lemma. Such methods can ease the modelling burden in control design but can be sensitive to disturbances acting on the system under control. In this paper, we extend these methods to incorporate segmented prediction trajectories. The proposed segmentation enables longer prediction horizons to be used in the presence of unmeasured disturbance. Furthermore, a computation time reduction can be achieved through segmentation by exploiting the problem structure, with computation time scaling linearly with increasing horizon length. The performance characteristics are illustrated in a set-point tracking case study in which the segmented formulation enables more consistent performance over a wide range of prediction horizons. The computation time for the segmented formulation is approximately half that of an unsegmented formulation for a horizon of 100 samples. The method is then applied to a building energy management problem, using a detailed simulation environment, in which we seek to minimise the discomfort and energy of a 6-room apartment. With the segmented formulation, a 72% reduction in discomfort and 5% financial cost reduction is achieved, compared to an unsegmented formulation using a one-day-ahead prediction horizon.