In the paper, iterative learning identification (ILI) and iterative learning control (ILC) for linear timevarying systems (LTVSs) with iteration varying lengths are investigated. A new ILI algorithm is firstly proposed, which makes the best of the available information in the incomplete iteration process. The identification speed of system parameters is improved. Then, on the basis of zero-compensation mechanism, a norm optimal ILC is presented for LTVSs with iteration varying lengths. From the perspective of iterative learning gain, the relationship between the two algorithms is analyzed when iterative learning gain is designed by using the identification model. Further, different from zero-compensation mechanism, a new compensation mechanism based on identification model obtained by ILI algorithm is proposed and an ILC algorithm by using compensation mechanism based on identification model is designed. The convergence speed for tracking performance of ILC algorithm with compensation mechanism based on identification model can be improved in comparison with the existing method. The convergence conditions of all algorithms are analyzed. An example is used to validate the designed algorithms.