FileConvertListing of Formats »
converts the contents of source to the format defined by the extension ext and writes the result to the file dest.ext.
writes the result to the filename defined by source, but with an extension defined by the specified format.
takes the contents of source to be in the specified format "format1".
Details and Options
- FileConvert can only be used to convert between compatible file formats, e.g. image file formats, audio file formats, etc.
- Files can be converted from formats supported by Import to formats supported by Export.
- Supported formats are listed in $ImportFormats and $ExportFormats.
- The format of a file is by default deduced by FileFormat.
- In FileConvert[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
- The output from FileConvert is written in the current working directory specified by Directory.
- The following options can be given:
CreateIntermediateDirectories True whether to create intermediate directories OverwriteTarget True whether to overwrite an existing file
- FileConvert[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
- In most cases, FileConvert is effectively equivalent to Export["file.ext",Import[source]].
Examplesopen allclose all
Basic Uses (6)
When no format is specified, FileConvert attempts to infer the format from the output file extension:
Format Types (8)
Use FileSystemMap to convert an entire directory of a certain file type to a new format:
Possible Issues (4)
FileConvert cannot create compressed archives:
Use CreateArchive to create compressed archives:
Wolfram Research (2019), FileConvert, Wolfram Language function, https://reference.wolfram.com/language/ref/FileConvert.html (updated 2020).
Wolfram Language. 2019. "FileConvert." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/FileConvert.html.
Wolfram Language. (2019). FileConvert. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileConvert.html