WOLFRAM

FileFormatQ[source,"fmt"]

gives True if the file corresponding to source might be imported as format "fmt" and gives False otherwise.

FileFormatQ[source,{"fmt1","fmt2",}]

gives True if source might be imported as one of "fmti".

Details and Options

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Check if a file might be a JPEG:

Out[4]=4

Check another file:

Out[5]=5

Check if a file might be in one of the image formats:

Out[1]=1

Scope  (1)Survey of the scope of standard use cases

Check if a URL might be a PDF:

Out[2]=2
Wolfram Research (2020), FileFormatQ, Wolfram Language function, https://reference.wolfram.com/language/ref/FileFormatQ.html.
Wolfram Research (2020), FileFormatQ, Wolfram Language function, https://reference.wolfram.com/language/ref/FileFormatQ.html.

Text

Wolfram Research (2020), FileFormatQ, Wolfram Language function, https://reference.wolfram.com/language/ref/FileFormatQ.html.

Wolfram Research (2020), FileFormatQ, Wolfram Language function, https://reference.wolfram.com/language/ref/FileFormatQ.html.

CMS

Wolfram Language. 2020. "FileFormatQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FileFormatQ.html.

Wolfram Language. 2020. "FileFormatQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FileFormatQ.html.

APA

Wolfram Language. (2020). FileFormatQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileFormatQ.html

Wolfram Language. (2020). FileFormatQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileFormatQ.html

BibTeX

@misc{reference.wolfram_2025_fileformatq, author="Wolfram Research", title="{FileFormatQ}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/FileFormatQ.html}", note=[Accessed: 15-April-2025 ]}

@misc{reference.wolfram_2025_fileformatq, author="Wolfram Research", title="{FileFormatQ}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/FileFormatQ.html}", note=[Accessed: 15-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_fileformatq, organization={Wolfram Research}, title={FileFormatQ}, year={2020}, url={https://reference.wolfram.com/language/ref/FileFormatQ.html}, note=[Accessed: 15-April-2025 ]}

@online{reference.wolfram_2025_fileformatq, organization={Wolfram Research}, title={FileFormatQ}, year={2020}, url={https://reference.wolfram.com/language/ref/FileFormatQ.html}, note=[Accessed: 15-April-2025 ]}