Swift heavy ion (SHI) induced modification in structural and optical properties of undoped and doped nanocrystalline (nc) ZnO films deposited by sol-gel method are investigated. These nanocrystalline films were irradiated by MeV ions of Au, Ag and Ni at various ion fluences. The structural properties were studied using X-ray diffraction and it shows that the average crystallite size of ZnO films is observed to increase by the irradiation. The atomic force microscopy (AFM) study of films shows that the roughness of the films varies with increase in the fluence. A maximum transmittance is observed to be 85% in the visible region for doped films. It is also shown that the bandgap of undoped and doped ZnO films is varied using SHI irradiation. The modifications of structural and optical properties are explained in terms of thermal spikes induced by SHIs.