FileFormat

Listing of Formats »

FileFormat[source]

attempts to determine what Import format could be used to import the file corresponding to source.

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

returns the first "fmti" that can be used to import source.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Determine the Import format of a file:

Restrict the format search to the specified list of formats:

If no format is suitable, return None:

Scope  (7)

Source  (3)

Determine the Import format of a file:

FileFormat gives the format name used by Import:

Determine the Import format of a URL:

Format  (4)

Check if a file might be "GZIP" compressed:

If not, None is returned:

Check if the format of the "GZIP" compressed file might be "3DS":

Check if a file might be one of several formats:

FileFormat returns the first format that matches:

Return all formats that match:

Options  (1)

MaxItems  (1)

By default, the first matched format is returned:

Return all matched formats:

Properties & Relations  (2)

A file name could match different formats:

FileFormat uses this list as a starting point to make a guess:

It is possible to create a file with an incorrect extension. Create a PNG file with a .jpg extension:

FileNameToFormatList only looks at the file name:

FileFormat uses more sophisticated heuristics to determine the correct format:

Possible Issues  (1)

FileFormat uses heuristics, which may not always be accurate, like giving "CSV" for an "MBOX" file:

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

Text

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

CMS

Wolfram Language. 2007. "FileFormat." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/FileFormat.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_fileformat, author="Wolfram Research", title="{FileFormat}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/FileFormat.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_fileformat, organization={Wolfram Research}, title={FileFormat}, year={2020}, url={https://reference.wolfram.com/language/ref/FileFormat.html}, note=[Accessed: 22-December-2024 ]}