Simply separate folder content according to file types; obtain a two-level output structure which contains a different folder for each extension.