TSV - Maple Help

Tab-Separated Values (.tsv) File Format

Tab-Separated Values

Description

 • TSV (Tab-Separated Values) is a simple text-based format for tabular data in which rows of data appear on subsequent lines and columns are delimited by tab characters.
 • The ImportMatrix and ExportMatrix commands can read and write TSV files.
 • The general-purpose commands Import and Export also support this format.
 • The default output from Import for this format is a DataFrame. To produce a Matrix, use Import(...,output=Matrix).

Notes

 • Content-Type: text/tsv, text/tab-separated-values

Examples

Import data from a TSV file to a DataFrame.

 > $\mathrm{Import}\left("example/PlanetaryData.tsv",\mathrm{base}=\mathrm{datadir}\right)$
 $\left[\begin{array}{ccccccccc}{}& {\mathrm{Mercury}}& {\mathrm{Venus}}& {\mathrm{Earth}}& {\mathrm{Mars}}& {\mathrm{Jupiter}}& {\mathrm{Saturn }}& {\mathrm{Uranus}}& {\mathrm{Neptune}}\\ {\mathrm{Mass \left(10^24 kg\right)}}& {0.33}& {4.87}& {5.97}& {0.642}& {1898}& {568}& {86.8}& {102}\\ {\mathrm{Diameter \left(km\right)}}& {4879}& {12104}& {12756}& {6792}& {142984}& {120536}& {51118}& {49528}\\ {\mathrm{Density \left(kg/m^3\right)}}& {5427}& {5243}& {5514}& {3933}& {1326}& {687}& {1271}& {1638}\\ {\mathrm{Gravity \left(m/s^2\right)}}& {3.7}& {8.9}& {9.8}& {3.7}& {23.1}& {9.0}& {8.7}& {11}\\ {\mathrm{Escape Velocity \left(km/s\right)}}& {4.3}& {10.4}& {11.2}& {5}& {59.5}& {35.5}& {21.3}& {23.5}\\ {\mathrm{Rotation Period \left(hr\right)}}& {1407.6}& {-5832.5}& {23.9}& {24.6}& {9.9}& {10.7}& {-17.2}& {16.1}\\ {\mathrm{Length of Day \left(hr\right)}}& {4222.6}& {2802}& {24}& {24.7}& {9.9}& {10.7}& {17.2}& {16.1}\\ {\mathrm{Distance from Sun \left(106 km\right)}}& {57.9}& {108.2}& {149.6}& {227.9}& {778.6}& {1433.5}& {2872.5}& {4495.1}\end{array}\right]$ (1)

Import data from a TSV file to a Matrix.

 > $\mathrm{Import}\left("example/PlanetaryData.tsv",\mathrm{base}=\mathrm{datadir},\mathrm{output}=\mathrm{Matrix}\right)$
 (2)

Import data from a TSV file and view in the worksheet.

 > $\mathrm{Import}\left("example/PlanetaryData.tsv",\mathrm{base}=\mathrm{datadir},\mathrm{output}=\mathrm{embed}\right)$

Compatibility

 • With Maple 2016, the Import command applied to TSV files now produces DataFrame objects by default.