Search code examples
vega-litevega

Is it possible to read a csv file in Vega with a custom delimiter, such as ;?


I have a csv file that has a custom delimiter, such as ;. I would like to load it into Vega a la:

"data": { "url": "https://url.csv",
          "format":{"type":"csv", 
          "sep":";"
        }

Here of course the last line does not exist in the current Vega schema.

This is akin to pandas pd.read_csv(sep=';')


Solution

  • Something like this should work:

    "data": { "url": "https://url.csv",
              "format":{"type":"dsv", "delimiter":";"}
            }
    

    See https://vega.github.io/vega-lite/docs/data.html#dsv for more information.