Changes

Jump to navigation Jump to search
660 bytes added ,  00:40, 23 September 2011
==CSV Parser==
BaseX can be used to import CSV document into documents. Different alternatives how to proceed are shown in the database. following:
===GUI===
SET PARSEROPT encoding=utf-8, lines=true, format=verbose, header=false, separator=comma
 
===XQuery===
 
The CSV parser can also be specified in the prolog of an XQuery expression.
The [[Database Functions#db:add|db:add()]] or [[Database Functions#db:replace|db:replace()]]
function can be used to add the specified source files into the database.
The following example query adds all CSV files to the database that are found
in the directory <code>2Bimported</code>, and interprets the first lines as
column headers:
 
<pre class="brush:xquery">
declare option db:parser "csv";
declare option db:parseropt "header=yes";
 
for $file in file:list("csv", true(), "*.csv")
return db:add('db', $file)
</pre>
==Text Parser==
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu