extractTextSchema

Syntax

extractTextSchema(filename, [delimiter], [skipRows=0])

Arguments

filename the input data file name with its absolute path.

delimiter the table column separator. The default value is ‘,’.

skipRows is an integer between 0 and 1024 indicating the rows in the beginning of the text file to be ignored. The default value is 0.

Details

Generate the schema table for the input data file. The schema table has 2 columns: column names and their data types.

Examples

$ n=1000000
$ timestamp=09:30:00+rand(18000,n)
$ ID=rand(100,n)
$ qty=100*(1+rand(100,n))
$ price=5.0+rand(100.0,n)
$ t1 = table(timestamp,ID,qty,price)
$ saveText(t1, "C:/DolphinDB/Data/t1.txt")
$ schema=extractTextSchema("C:/DolphinDB/Data/t1.txt");
$ schema;

name

type

timestamp

SECOND

ID

INT

qty

INT

price

DOUBLE