title: Select specific files with their name in folders then manipulate them (Python)
body: <p>I am trying to write a script to select specific files from their names in several folders and them copy those files in a new folder.</p>
  <p>More precisely, I have a directory that contains 29 folders, in each folders there are hundreds of '*.fits' files.</p>
  <p>I want to select among those fits files those which do not have the numbers '4' or '8' in the last 3 digits before .fits</p>
  <p>For example: &quot;ngc6397id016000520jd2456870p5705f002.fits&quot; has '002' as last three digits before the extension .fits</p>
  <p>I am kind of lost here as I am pretty new to this, can anyone help ?</p>
  <p>Thank you!</p>