Parse delimiter-separated text into a DataFrame
with readTable(). Mirrors
pandas
read_table() — identical to readCsv() but defaults
to a tab (\t) separator.
Edit any code block below and press ▶ Run
(or Ctrl+Enter) to execute it live in your browser.
By default readTable() splits on tabs, infers column dtypes,
and returns a DataFrame.
Pass sep to use any delimiter — pipe, semicolon, or
multi-character strings.
readTable() recognises common NA strings (NA,
N/A, null, …) and converts them to
NaN. Extend the list with naValues.
Use indexCol to promote a column to the row index.
nRows caps the number of data rows read; skipRows
skips rows after the header.
Parse a delimiter-separated text string into a DataFrame.
Defaults to tab (\t) unlike readCsv which uses
a comma.
readTable(text: string, options?: ReadTableOptions): DataFrame
interface ReadTableOptions {
sep?: string; // separator (default: "\t")
header?: number | null; // header row index (default: 0)
indexCol?: string | number | null; // column to use as row index
dtype?: Record<string, DtypeName>; // force dtype for named columns
naValues?: readonly string[]; // extra NA string values
skipRows?: number; // data rows to skip after header
nRows?: number; // maximum data rows to read
}