FileFormatQ
Listing of Formats »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
- FileFormatQ attempts to identify whether a file can be imported as a specific format.
- In FileFormatQ[source,…], source can be any of the following:
-
"file" or File["file"] file name, searched for on $Path "url" or URL["url"] HTTP, HTTPS or FTP URL - FileFormatQ uses heuristic methods and may not give correct results, particularly for shorter files.
- FileFormatQ does not verify that Import would succeed if applied to source.
- FileFormatQ gets clues from both names of files and properties of files recorded in the filesystem, but bases the final result it returns only on the actual contents of files.
- FileFormatQ[url] accepts the following URLDownload options:
-
Authentication None authentication information to send CookieFunction Automatic function to apply to each cookie received ConnectionSettings Automatic speed and other settings for the connection FollowRedirects True whether to follow HTTP redirects Interactive True whether to allow interactive authentication dialogs TimeConstraint Infinity time to wait for a response VerifySecurityCertificates True whether to verify SSL security certificates
Examples
open allclose all
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.
CMS
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