Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Import tab delimited data using a dictionary but using tab and ignore space

    I have some tab delimited data that looks like this:

    b783288b-1c0e-4490-a3b1-ce8eae01df15<T>ODKTOOLS 2.0<T>assistant001<T>LB_Sequia_MAG_20190123<T>2022-03-01 19:41:34<T>9.907472134 -85.409352785 103.794494045 24.0<T>-85.409352785<T>9.907472134<T>103.794<T>24.000<T>1

    Im trying to import it using a dictionary like:

    dictionary using "maintable.raw" {
    strL surveyid
    strL originid
    strL _submitted_by
    strL _xform_id_string
    strL _submitted_date
    strL _geopoint
    float _longitude
    float _latitude
    float _elevation
    float _precision
    long _active
    }

    When I run it I get:
    . infile using "maintable.dct"

    dictionary using "maintable.raw" {
    strL surveyid
    strL originid
    strL _submitted_by
    strL _xform_id_string
    strL _submitted_date
    strL _geopoint
    float _longitude
    float _latitude
    float _elevation
    float _precision
    long _active
    }


    '19:41:34' cannot be read as a number for _longitude[1]
    (1 observation read)

    The infile command is using tab and spaces to separate the variables. How can I indicate to just use tab?

  • #2
    I think you will be be better off using import delimited to import your data. The infile command is not flexible enough to handle strings with embedded spaces that are not surrounded with quotation marks. Perhaps import everything as strings, and then rename variables and destring variables meant to be float.

    Comment

    Working...
    X