FileConvert

Listing of Formats »

FileConvert[source"dest.ext"]

converts the contents of source to the format defined by the extension ext and writes the result to the file dest.ext.

FileConvert[source,"format"]

writes the result to the filename defined by source, but with an extension defined by the specified format.

FileConvert[source"dest.ext","format1""format2"]

takes the contents of source to be in the specified format "format1".

Details and Options

Examples

open allclose all

Basic Examples  (2)

Convert a CSV file to TSV:

Convert a GIF to PNG, specifying a new filename:

Scope  (14)

Basic Uses  (6)

When no format is specified, FileConvert attempts to infer the format from the output file extension:

Specify the output file format:

When the output filename is not specified, the same filename is used with the new extension:

Specify the input and output formats:

Input and output formats can be specified regardless of extension:

Convert a PDF to a multi-frame PNG:

Format Types  (8)

3D  (1)

Convert an OBJ file to STL:

Audio  (1)

Convert a WAV file to MP3:

This conversion can be used for reducing the file size:

Image  (2)

Convert a TIFF image to JPEG:

Convert an animated GIF to an animated PNG:

Tabular  (2)

CSV and TSV can be reliably converted between the two formats:

Convert CSV to XLSX:

Note that the data is saved in the first sheet of the XLSX file:

Video  (2)

Convert an MKV file to MP4:

Create an FLV file and convert to MP4, which requires a full FFmpeg installation:

Convert to "MP4":

Options  (3)

CreateIntermediateDirectories  (1)

By default, missing directories are created:

With CreateIntermediateDirectoriesFalse, missing directories are not created:

OverwriteTarget  (2)

By default, FileConvert overwrites any existing output file:

Use OverwriteTargetFalse to prevent overwriting existing files:

Applications  (1)

Use FileSystemMap to convert an entire directory of a certain file type to a new format:

Only convert files with a certain extension:

Possible Issues  (4)

A file cannot be converted to an incompatible format:

FileConvert cannot create compressed archives:

Use CreateArchive to create compressed archives:

XLS and XLSX data is grouped into sheets and thus cannot be converted to CSV or TSV:

XLSX and XLS data can be efficiently converted sheet by sheet using Import and Export:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

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