如何将纯文本文件添加到BaseX? [英] how to add a flat text file to BaseX?

查看:80
本文介绍了如何将纯文本文件添加到BaseX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

序言中不允许包含内容"是什么意思?也许需要首先设置输入法?我正在尝试使用

选择文件:

解决方案

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

 >>列表名称资源大小输入路径-------------------------------------------------------------------------------com.w3schools.books 1 6290 https://www.w3schools.com/xml/books.xml假人1 21119foo 1 167152/home/thufir/basex/foo/foo.fodt人数1 4610文字1 55302/home/thufir/Desktop/text.txt推特45 366800w3school_data 1 5209 https://www.w3schools.com/xml/note.xml7个数据库.>删除数据库人员数据库人员"已删除.>>创建数据库人员数据库人员"在79.03毫秒内创建.>>开放的人数据库人员"在0.05毫秒内打开.>>设置解析器文本PARSER:文字>>添加到人员/home/thufir/flwor/people/people.txt在9.18毫秒内添加了资源.>>列表名称资源大小输入路径-------------------------------------------------------------------------------com.w3schools.books 1 6290 https://www.w3schools.com/xml/books.xml假人1 21119foo 1 167152/home/thufir/basex/foo/foo.fodt人数1 4610文字1 55302/home/thufir/Desktop/text.txt推特45 366800w3school_data 1 5209 https://www.w3schools.com/xml/note.xml7个数据库.>>出口玩得开心.thufir @ dur:〜/flwor/people $ 

What does it mean "content is not allowed in prolog"? Perhaps the input method needs to be set first? I'm trying to add data to an empty database in Basex with dummy data as below:

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$ 

I could make it CSV or other, but would like to use just plain text.

Certainly it can be added through the GUI as:

Selecting the file:

解决方案

Okay, that was perhaps a silly question:

> 
> 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$ 

这篇关于如何将纯文本文件添加到BaseX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆