SemanticImportString["string"]
attempts to import a string semantically to give a Dataset object.
SemanticImportString["string",type]
attempts to interpret all elements in the string as being of the specified type.
SemanticImportString["string",{type1,type2,…}]
attempts to interpret elements in successive columns as being of the specified types.
SemanticImportString["string",col1->type1,col2->type2,…]
attempts to interpret elements in the named columns as being of the specified types.
SemanticImportString["string",typespec,form]
puts the result in the specified form.


SemanticImportString
SemanticImportString["string"]
attempts to import a string semantically to give a Dataset object.
SemanticImportString["string",type]
attempts to interpret all elements in the string as being of the specified type.
SemanticImportString["string",{type1,type2,…}]
attempts to interpret elements in successive columns as being of the specified types.
SemanticImportString["string",col1->type1,col2->type2,…]
attempts to interpret elements in the named columns as being of the specified types.
SemanticImportString["string",typespec,form]
puts the result in the specified form.
Details and Options

- SemanticImportString has identical functionality to SemanticImport, except that it takes its input from a string rather than the contents of a file.
- SemanticImportString takes the following options:
-
CharacterEncoding "UTF-8" character encoding in the response body Delimiters Automatic delimiters to insert between elements ExcludedLines {} lines to exclude from result HeaderLines Automatic line numbers to treat as headers MissingDataRules Automatic rules for replacing data to be considered "missing"
Examples
open all close allBasic Examples (6)
Scope (4)
Import a string using the given delimiter:
Specify that the first line of the string to import is a header:
Specify that the first and third lines of the given string should be skipped:
Return missing values with the form "Unknown" in the special form Missing["UnknownData"]:
Options (9)
Delimiters (2)
HeaderLines (2)
Applications (3)
Import a list of quantities as a Dataset object:
Import quantities as an array:
Apply any string transformations to the input file. In this case, the full text is simply set to uppercase:
Possible Issues (4)
The interpretation of data depends upon its context. Without further context, "12,3" is interpreted as a date:
In the context of the value "45,4", which is not a valid date, "12,3" is interpreted as two integers:
SemanticImportString, unlike SemanticInterpretation, does only simple, quick inferences. SemanticImportString imports state names as strings:
SemanticInterpretation imports state names as Entity objects:
Automatic type selection chooses from a smaller set of interpretations rather than specifying a type explicitly:
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:
See Also
SemanticImport SemanticInterpretation Interpreter WolframAlpha ImportString Dataset
Function Repository: AddSemantics
Related Guides
History
Text
Wolfram Research (2014), SemanticImportString, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticImportString.html.
CMS
Wolfram Language. 2014. "SemanticImportString." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SemanticImportString.html.
APA
Wolfram Language. (2014). SemanticImportString. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SemanticImportString.html
BibTeX
@misc{reference.wolfram_2025_semanticimportstring, author="Wolfram Research", title="{SemanticImportString}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/SemanticImportString.html}", note=[Accessed: 14-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_semanticimportstring, organization={Wolfram Research}, title={SemanticImportString}, year={2014}, url={https://reference.wolfram.com/language/ref/SemanticImportString.html}, note=[Accessed: 14-August-2025]}