SQL Notebook (logo)

IMPORT TXT Statement

Reads a text file (.TXT) from disk into a notebook table. Each line of text in the file becomes a two-column row in the target table. One column contains a line number (starting at 0) and the other column contains the text of the line.


Syntax for the IMPORT TXT statement




  1. IMPORT TXT 'C:\MyFile.txt' INTO mytable;
    Reads the text in "MyFile.txt" into a notebook table called mytable. Because no options are specified, the whole file is read.
  2. IMPORT TXT 'C:\MyFile.txt' INTO mytable OPTIONS (TAKE_LINES: 10);
    Only the first 10 lines of "MyFile.txt" are read into mytable.