With the development of information technology and sensors, the large industrial system has become a data-rich environment, which leads to the rapid development and application of deep learning for the remaining useful life prediction, especially for the turbofan engine. Currently, the deep architecture of CNN, LSTM have been used to address the RUL estimation of a turbofan engine. However, they are mainly focused on simulation degradation data. The new realistic run-to-failure turbofan engine degradation dataset has been published in 2021, which presents a significant difference from the simulation one. The main challenge is that the flight duration of each cycle is different, which will result in the current deep method hardly used for predicting the RUL for the practical degradation data. To tackle this challenge, we propose a novel Transformer-based model using guiding features to deal with the unfixed-length data. Besides, our G-Transformer model makes use of multi-head attention to access the global features from various representation subspaces. We conduct experiments on turbofan engine degradation data with variable-length input under practical flight conditions. Empirical results and feature visualization via t-SNE indicate the effectiveness of the G-Transformer model for RUL estimation of turbofan engines.