I have data of the form:
X 1.213 'String Field With Lots of Spaces' 8.123
Y 2.43 'String Field With Lots of Spaces' 8.123
Z 4.83 'String Field With Lots of Spaces' 8.123
I'm trying to import it using the builtin "Table"
format (or anything else that would work). Problem is, my field delimiter, a space, can occur within my text delimiters, as the above shows. Setting "FieldDelimiters"->" "
and "TextDelimiters"->"'"
does not do the trick. Is this possible or do I have to roll my own importer?
The data is a 2D array. The problem in reality is a little more complicated, in that I have two types of text delimiters, '
and "
, and one can contain the other. And so a string can be of the form 'String "With" Lots" of Quotes'
or "String 'With' Lots' of Quotes"
. I don't a priori know the type of entries in a column, their ordering, or their widths. I.e. everything has to be inferred on the fly.
Note I am not asking for code to do this from scratch: I can do it myself. I'm just wondering if the builtin importers support this.
Import[file, "Table", "TextDelimiters" -> "'"]
works for the first example.. $\endgroup$ – george2079 Nov 8 '16 at 15:12