returns lists of file formats corresponding to all registered file name patterns.
FileNameToFormatList["file"]
returns a list of file formats that matches the file name "file".
FileNameToFormatList
Listing of Formats »returns lists of file formats corresponding to all registered file name patterns.
FileNameToFormatList["file"]
returns a list of file formats that matches the file name "file".
Details
- FileNameToFormatList returns a list of file formats that matches the file name.
- FileNameToFormatList returns a list of all formats {"fmt1",…} in the order that they are considered to be used as the format for the file given in the specified pattern.
Examples
open all close allBasic Examples (2)
Scope (1)
Properties & Relations (4)
Filename and extension mapping is case insensitive:
FileNameToFormatList /@ {"jpg", "JPG"}A file name could match different formats:
FileNameToFormatList[".cdf"]FileFormat uses this list as a starting point to make a guess:
FileFormat["ExampleData/cacsst2.cdf"]The first format returned by FileNameToFormatList is used by default in Export:
FileNameToFormatList["file.cdf"]Export["data.cdf", RandomInteger[100, 10]]FileFormat[%]Specify a different export format:
Export["data.cdf", RandomInteger[100, 10], "NASACDF"]FileFormat[%]It is possible to create a file with an incorrect extension. Create a PNG file with a .jpg extension:
Export["file.jpg", RandomImage[], "PNG"]FileNameToFormatList only looks at the file name:
FileNameToFormatList["file.jpg"]FileFormat uses more sophisticated heuristics to determine the correct format:
FileFormat["file.jpg"]See Also
Export FileFormatProperties SetFileFormatProperties MIMETypeToFormatList FileFormat FileFormatQ FileNames FileExtension
Front End Tokens: Import
Related Guides
History
Text
Wolfram Research (2021), FileNameToFormatList, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameToFormatList.html.
CMS
Wolfram Language. 2021. "FileNameToFormatList." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FileNameToFormatList.html.
APA
Wolfram Language. (2021). FileNameToFormatList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileNameToFormatList.html
BibTeX
@misc{reference.wolfram_2026_filenametoformatlist, author="Wolfram Research", title="{FileNameToFormatList}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/FileNameToFormatList.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_filenametoformatlist, organization={Wolfram Research}, title={FileNameToFormatList}, year={2021}, url={https://reference.wolfram.com/language/ref/FileNameToFormatList.html}, note=[Accessed: 12-June-2026]}