Check the format of file