There's a safer method:
`jsonfilename = os.path.splitext(f)[0].split('_')`. It's unlikely but what if the file is called something crazy like `foo.format.json.version1.json` or `foo.json~`.