correctly detect table format in filename - Fixes #10