This is documentation for Mathematica 4, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

 Documentation /  Mathematica /  Eingebaute Funktionen /  Neu in Version 4 /  Eingabe und Ausgabe /

StringDrop (geändert)Export

Import

FilledSmallSquare Import["name.erw"] importiert Daten aus einer Datei und nimmt dabei ein Format an, das durch die Dateinamenserweiterung erw angedeutet ist, und wandelt sie in einen Mathematica-Ausdruck.

FilledSmallSquare Import["datei", "format"] importiert Daten im spezifizierten Format aus einer Datei.

FilledSmallSquare Import versucht, einen Mathematica-Ausdruck zu liefern, dessen Bedeutung eine größtmögliche Übereinstimmung mit den Daten in der externen Datei aufweist.

FilledSmallSquare Import kann Text- und Tabellendaten, sowie Grafiken und Töne verarbeiten.

FilledSmallSquare Die folgenden Grundformate werden bei Text- und Tabellendaten unterstützt:

FilledSmallSquare "Text" und "UnicodeText" liefern einzelne Mathematica-Zeichenketten.

FilledSmallSquare "Lines" und "Words" liefern Listen mit Mathematica-Zeichenketten.

FilledSmallSquare "List" liefert eine Liste mit Mathematica-Zahlen oder -Zeichenketten.

FilledSmallSquare "Table" liefert eine Liste, die Listen mit Mathematica-Zahlen oder -Zeichenketten enthält.

FilledSmallSquare Im "List"- und "Table"-Format können Zahlen in C- oder Fortran-ähnlicher „E"-Schreibweise gelesen werden.

FilledSmallSquare Zahlen ohne explizite Dezimalpunkte werden als exakte ganze Zahlen zurückgegeben.

FilledSmallSquare Im "Table"-Format können Spalten durch Leerzeichen oder Tabulator getrennt werden.

FilledSmallSquare Im "Words"-Format können Wörter durch Weißraum getrennt werden.

FilledSmallSquare Import["name.txt"] verwendet "Text"-Format.

FilledSmallSquare Import["name.dat"] verwendet "Table"-Format.

FilledSmallSquare Die folgenden zusätzlichen Formate werden bei numerischen Daten auch unterstützt:

FilledSmallSquare Zweidimensionale Grafikformate werden als Graphics-Objekte importiert; Ton-Formate werden als Sound-Objekte importiert.

FilledSmallSquare Animierte Grafiken werden als Listen von Graphics-Objekten importiert.

FilledSmallSquare Die folgenden Formate ergeben Ausdrücke der Form Graphics[data, opts]:

FilledSmallSquare Die folgenden Formate ergeben Ausdrücke der Form Graphics[Raster[data], opts]:

FilledSmallSquare Importierte Rasterdaten bestehen in der Regel aus ganzen Zahlen; mit ColorFunction wird häufig eine Farbtabelle spezifiziert.

FilledSmallSquare Die folgenden Formate ergeben Ausdrücke der Form Sound[SampledSoundList[data, r]]:

FilledSmallSquare Die folgenden allgemeinen Optionen können angegeben werden:

FilledSmallSquare Die von Import möglichen akzeptierten Formate werden in der Liste $ImportFormats angegeben.

FilledSmallSquare Import["!prog", "format"] importiert Daten aus einer Pipe.

FilledSmallSquare Siehe auch: Export, ImportString, $ImportFormats, ReadList.

Additional Information

Many Import formats have private options which are specified using the option ConversionOptions: Import["file", "format", ConversionOptions -> opts].

GIF

FilledSmallSquare The following options can be given:

FilledSmallSquare The option "ColormapOutput" determines whether a GIF is imported as a Raster graphics primitive with a color map ColorFunction and a matrix of indices into the color map, or whether the imported Raster graphics primitive contains a normal matrix of sample values. A grayscale image will import without the use of a color map ColorFunction.

FilledSmallSquare If the GIF is an animated GIF with multiple frames, "ImageIndex" -> i will select a particular frame to import. "ImageIndex" -> , , ... will select a list of frames from the animated GIF. By default all frames of an animated GIF are imported.

HDF

FilledSmallSquare The following option can be given:

FilledSmallSquare HDF files can contain multiple datasets in a single file. By default, the first dataset in an HDF file is imported. "DatasetSelection" -> i will attempt to import the dataset at index i. "DatasetSelection" -> string will attempt to find a dataset named with label string. "DatasetSelection" -> Information will not import the datasets in the file but instead return a list of length equal to the number of datasets in the file and contain information about the format types, names, and dimensions of the datasets.

FilledSmallSquare Import of HDF currently only supports the "scientific datasets" SDS interface.

JPEG

FilledSmallSquare The following options can be given:

FilledSmallSquare Although the JPEG format is not stored as a color-mapped image, Import can color reduce or quantize the JPEG as it is being imported. By default no color reduction is done.

FilledSmallSquare Using a "ColorReductionDither" method can provide better resulting images once a color map is chosen by dithering the resulting image. "ColorReductionDither" -> "Ordered" provides relatively fast and medium quality dithering, while "ColorReductionDither" -> "Floyd-Steinberg" provides the best quality error-diffusion dithering, requiring more time and memory. "ColorReductionDither" -> None will perform no dithering on the imported image.

FilledSmallSquare "ColorReduction" -> "Fixed" chooses evenly spaced colors from a color space, which may not pick the most optimal colors for the image. "ColorReduction" -> "Adaptive" uses a median-cut algorithm to choose the optimal set of colors for an image.

FilledSmallSquare "ColorReductionPalette" -> Automatic will choose an adaptive set of at most 256 colors. "ColorReductionPalette" -> n will choose at most n colors for the color palette. "ColorReductionPalette" -> , , ... specifies a list of color directives to use to color reduce the image. The values for must be CMYKColor, GrayLevel, Hue or RGBColor directives. The number of colors chosen for "ColorReductionPalette" must be between 2 and 256.

FilledSmallSquare The following example produces an image using a color map of "browser safe" 216 colors: Import["file.jpg", "JPEG", ConversionOptions -> {"ColorReduction" -> "Fixed", "ColorReductionPalette" -> 216}].

FilledSmallSquare Color reduction of JPEG images only applies to JPEG images with three color components. If you are producing these JPEG images yourself, you can force the use of three color components with Export and "Colorspace" -> "RGBColor": Export["file.jpg", gr, "JPEG", ConversionOptions->{"Colorspace" -> RGBColor}].

FilledSmallSquare The option "Colorspace" can be explicitly set to RGBColor or GrayLevel to force the resulting imported image to a specific color space.

List

FilledSmallSquare The following options can be given:

FilledSmallSquare The option "DateStyle" can be set to the values "American", "European", or "Scientific".

PBM, PGM, PPM, PNM

FilledSmallSquare The following options can be given:

FilledSmallSquare "CheckDepth" -> True will check the data on importing to see if the actual data stored in the image could be represented by a reduced color space. For example, if a PPM file contains identical red, green and blue components for all pixels, a Raster of graylevels is imported.

FilledSmallSquare Although the PBM formats are not stored as a color-mapped image, Import can color reduce or quantize the PBM as it is being imported. By default no color reduction is done. "ColorReduction" -> True will perform color quantization.

FilledSmallSquare By dithering the resulting image, "ColorReductionDither" -> True will provide better resulting images once a color map is chosen.

FilledSmallSquare "ColorReductionPalette" -> Automatic will choose an adaptive set of at most 256 colors. "ColorReductionPalette" -> n will choose at most n colors for the color palette. "ColorReductionPalette" -> , , ... specifies a list of color directives to use to color reduce the image. The values for must be CMYKColor, GrayLevel, Hue or RGBColor directives. The number of colors chosen for "ColorReductionPalette" must be between 2 and 256.

Table

FilledSmallSquare The following options can be given:

FilledSmallSquare The option "DateStyle" can be set to the values "American", "European", or "Scientific".

FilledSmallSquare A field is considered to be a date if it consists of three adjacent, forward slash-delimited integers of which the month, day, and year values appear to be reasonable. Months must be between 1 and 12 inclusive. The day must not lie outside the valid range of days for the given month. A year's validity can be determined indirectly by "TwoDigitYearFunction".

FilledSmallSquare A date field will be broken into a list of the form year, month, day.

FilledSmallSquare The option "TwoDigitYearFunction" can be set to None, Automatic, or an arbitrary function.

FilledSmallSquare Setting the "TwoDigitYearFunction" to its default value of None keeps the date field from being interpreted as a date if the year has only two-digits.

FilledSmallSquare When "TwoDigitYearFunction" is set to Automatic, 1900 is added to the year and the field is interpreted as a date.

FilledSmallSquare User-defined functions for "TwoDigitYearFunction" must return Integer values.

TIFF

FilledSmallSquare The following options can be given:

FilledSmallSquare "CheckDepth" -> True will check the data on importing to see if the actual bit depth of the TIFF is smaller than one byte per image sample, and this can result in a Raster with integer values scaled to a more exact representation of what was stored in the TIFF. For example, a 4-bit TIFF image would be imported as a Raster with a matrix of integer values between 0 and 15 and not the normal 0 to 255 associated with a byte of image sample information.

FilledSmallSquare If the TIFF contains multiple images, "ImageIndex" -> i will select a particular image to import. "ImageIndex" -> , , ... will select a list of images from the TIFF. By default all images of a TIFF are imported.

StringDrop (geändert)Export