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
- In most cases, FileConvert is effectively equivalent to Export["file.ext",Import[source]].
Examplesopen allclose all
Basic Uses (4)
When no format is specified, FileConvert attempts to infer the format from the output file extension:
Format Types (6)
Use FileSystemMap to convert an entire directory of a certain file type to a new format: