How to create dataframe from tab separated string context

Hi team,

I am looking into a way to convert tab separated text content into a valid Dataframe. Is there a way to do so? I was playing around with “\t” as tab separator but somehow datagrok does not pick it up as separate columns (the new Dataframe has just one big column joint column)?

I’m surprised it doesn’t work as Datagrok is pretty good at auto-detecting separators, for instance the following code works as expected:

// Creating a DataFrame from a tab-separated file

let table = DG.DataFrame.fromCsv(
  `make\tmodel
Honda\tCivic
Honda\tAccord`);

grok.shell.addTableView(table);

You can also explicitly specify a delimiter:

DG.DataFrame.fromCsv(
  `make\tmodel
Honda\tCivic
Honda\tAccord`, {delimiter: '\t'});

Got it working now! It seems that our code was escaping the \t so the delimiter was wrongly set at the end (\\t instead of \t).

Thanks for providing fast answer to this. It is working now as expected!