Hi Ben,
This may be the directory where you started the BaseX server from. If you use the client/server architecture, both the client and the server can have different working directories, so you should always specify full paths.
Cheers,
Christian
Hi Christian,
The alternative worked so my first question is answered. But the second
question still remains.
Why does BaseX-GUI use an old path
(/home/bengbers/DataScience/Eindopdracht/Data/file), a path I didn't
even enter and does not use the path I entered in the query
(/home/bengbers/DataScience/RBaseX/Examples/Parse/)?
Cheers,
Ben
Op 01-06-18 om 12:38 schreef Christian Grün:
> Hi Ben,
>
> As file:list only returns relative file paths, you will have to prepend
> the root path later on:
>
> let $root := "/home/bengbers/DataScience/RBaseX/Examples/Parse/"
> for $file in file:list($root, false(), "*.csv")
> return db:add("CSV_test", $root || $file, "", map {
> 'parser': 'csv',
> 'csvparser': map { 'header': 'yes', 'separator': ';' }
> })
>
> Another alternative is to use the file:children function:
>
> let $root := "/home/bengbers/DataScience/RBaseX/Examples/Parse/"
> for $path in file:children($root)[ends-with(., ".csv")]
> return db:add("CSV_test", $path, "", map { ... })
>
> Cheers,
> Christian