We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technology expertise.
SemanticImport[file,type]
attempts to interpret all elements in the file as being of the specified type.
SemanticImport[file,{type1,type2,…}]
attempts to interpret elements in successive columns as being of the specified types.
SemanticImport[file,col1->type1,col2->type2,…]
keeps only the columns coli specified by their positions or names.
SemanticImport[file,typespec,form]
puts the result in the specified form.
Details and OptionsImport a file, automatically detecting and interpreting dates and cities:
Columns shown in bold correspond to semantic objects in the Wolfram Language:
Import a file with the specified column types:
Import only some columns of a file, in the specified format, using column numbers:
Import only some columns of a file, in the specified format, using column names:
Import only some columns, specifying None for columns that should be dropped:
Import a file as a list of rows:
Import a file as a list of columns:
Scope (3)Import a file using a given character encoding:
Import a file using the given delimiter:
Specify that the first line of the file to import is a header:
Specify that the first and fifth lines of a file should be skipped:
Return missing values with the form "Unknown" in the special form Missing["UnknownData"]:
Options (7)SemanticImport uses many of the same options as SemanticImportString. See SemanticImportString for more examples.
CharacterEncoding (1)The wrong character encoding can derail a good interpretation. Create a file of Unicode-encoded data:
Import the data using the default character encoding:
Import the data, specifying that it is encoded as Unicode:
Delimiters (1)Specifying the delimiter determines how the values are separated:
Specifying a nonexistent delimiter gives a single column of newline-separated items:
ExcludedLines (1)Lines are excluded by row number prior to header selection or further processing. Here is raw data:
Excluding even line numbers gives the odd-ranked buildings, since the header line puts odd ranks on even lines:
HeaderLines (1)Specify the number of lines in the file to treat as a header:
MissingDataRules (2)Replace strings that start with "Sears" by "Willis Tower":
Rules are applied before interpretation:
Applications (6)Import a table containing the flight cost from London to many countries as a Dataset object:
Get the geographic position of London:
Get the maximum price of a flight:
Make a map showing the least expensive flight routes in blue and the most expensive ones in orange:
Import the data for a timeline of personal emails:
Get the values that are in the "family" category:
Import the first and third columns from a table of salaries for college faculty members:
Import a dataset consisting of dates and numeric values as a Dataset object:
Obtain the data as a list of rows:
Specify that dates should be interpreted as strings:
Import a dataset containing a list of famous buildings and their properties as a Dataset object. Cities and countries are automatically detected as Entity objects:
Import only the Name, Country, and Height columns of the famous building dataset:
Possible Issues (3)Automatic selection chooses from a less rich set of types than Interpreter:
Specify explicit types to import Entity objects rather than strings:
An Automatic type specifies an automatically selected number of columns:
An {Automatic} type specifies a single column of automatically selected type:
Automatic in a type list applies to the corresponding column sequentially:
The default Automatic selection of header lines can be incorrect, depending on whether data is organized in rows or columns:
Specify the number of header lines explicitly to import the data correctly:
Wolfram Research (2014), SemanticImport, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticImport.html (updated 2016). TextWolfram Research (2014), SemanticImport, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticImport.html (updated 2016).
CMSWolfram Language. 2014. "SemanticImport." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/SemanticImport.html.
APAWolfram Language. (2014). SemanticImport. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SemanticImport.html
BibTeX@misc{reference.wolfram_2025_semanticimport, author="Wolfram Research", title="{SemanticImport}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/SemanticImport.html}", note=[Accessed: 12-July-2025 ]}
BibLaTeX@online{reference.wolfram_2025_semanticimport, organization={Wolfram Research}, title={SemanticImport}, year={2016}, url={https://reference.wolfram.com/language/ref/SemanticImport.html}, note=[Accessed: 12-July-2025 ]}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4