如何将纯文本文件添加到BaseX?

问题描述 投票:0回答:1

[序言中不允许包含什么内容?也许需要首先设置输入法?我正在尝试使用Basex数据将数据添加到dummy中的空数据库中,如下所示:

thufir@dur:~/flwor/people$ 
thufir@dur:~/flwor/people$ basex
BaseX 9.0.1 [Standalone]
Try 'help' to get more information.
> open people
Database 'people' was opened in 199.0 ms.
> 
> add to people /home/thufir/flwor/people/people.txt
"/home/thufir/flwor/people/people.txt" (Line 2): Content is not allowed in prolog.
> 
> exit
Have a nice day.
thufir@dur:~/flwor/people$ 
thufir@dur:~/flwor/people$ cat people.txt 

a
1
2
3
b
4
5
6
c
7
8
9

thufir@dur:~/flwor/people$ 

我可以将其设为CSV或其他名称,但只想使用纯文本。

当然,它可以通过GUI添加为:

added

选择文件:

adding resource

xml database nosql command-line-interface basex
1个回答
0
投票

好吧,这也许是一个愚蠢的问题:

> 
> list
Name                 Resources  Size    Input Path                               
-------------------------------------------------------------------------------
com.w3schools.books  1          6290    https://www.w3schools.com/xml/books.xml  
dummy                1          21119                                            
foo                  1          167152  /home/thufir/basex/foo/foo.fodt          
people               1          4610                                             
text                 1          55302   /home/thufir/Desktop/text.txt            
twitter              45         366800                                           
w3school_data        1          5209    https://www.w3schools.com/xml/note.xml   

7 database(s).
> drop database people
Database 'people' was dropped.
> 
> create database people
Database 'people' created in 79.03 ms.
> 
> open people
Database 'people' was opened in 0.05 ms.
> 
> set parser text
PARSER: text
> 
> add to people /home/thufir/flwor/people/people.txt
Resource(s) added in 9.18 ms.
> 
> list
Name                 Resources  Size    Input Path                               
-------------------------------------------------------------------------------
com.w3schools.books  1          6290    https://www.w3schools.com/xml/books.xml  
dummy                1          21119                                            
foo                  1          167152  /home/thufir/basex/foo/foo.fodt          
people               1          4610                                             
text                 1          55302   /home/thufir/Desktop/text.txt            
twitter              45         366800                                           
w3school_data        1          5209    https://www.w3schools.com/xml/note.xml   

7 database(s).
> 
> exit
Have fun.
thufir@dur:~/flwor/people$ 
© www.soinside.com 2019 - 2024. All rights reserved.