使用PostgreSQL中的copy命令从文本文件导入数据

时间:2015-11-06 10:39:32

标签: postgresql

我创建了包含3列的表:DocumentID,SentenceId,Sentence。我想自己分配DocumentId,SentenceID增加自身,并将文本文件中的数据插入到省略第一个数字的列句中。例如,文本文件中有一个文本:

0,189   A   few years   ago ,   when    I   was looking at  middle  schools for my  daughter. 
190,412 Having  reported    on  a   vogue   for single-sex  classrooms  in  the nineties.

在表格中导入此文本文件后,我希望得到如下内容:

DocumentID | SentenceID | Sentence  
123        |     1      | A few years ago, when...  
123        |     2      | Having reported on a vogue....   

0 个答案:

没有答案