Hi Jan,

i just tried and it worked for me, lets see an example:

enter in command bar: create db test
go to Add documents and add a XML file
enter in command bar: set parser csv
go to Add documents and add a CSV file

Thats it.

We will consider adding a parser combo box to the Add documents menu.

I hope this helps,
Kind regards,
Andreas

Am 18.01.11 14:14, schrieb Jan Vlčinský (CAD):
Hi Andreas
Yes, creation of new database from CSV files works perfectly - I overlooked the Parsing tab.

However - is there some easy way to mix imported formats in one database?

I would think of scenario like
  1. create database using XML data
  2. add more documents, if needed, use CSV format (so parser shall be changed)
  3. later add other XML (parser shall be probably changed back)
Menu command "Database - Add documents" does not offer an option to change parser. I tested new database based on CSV parser and later added XML document. XML document was parsed using CSV parser, what was not what I needed (but was quite logical).
Of course I can use workaround to import CSV always into separate database and then either query with explicit database name for CSV data, or export imported CSV as XML and import into main "XML parser based" database.

Is there any way to switch parser in existing database?

Jan

PS: Be sure, that availability of any CSV import (the same will apply to text and html) is great service as is.



2011/1/18 Andreas Weiler <andreas.weiler@uni-konstanz.de>
Hi Jan,

i just tried it and it worked for me.
I did use the GUI and changed in the parsing tab to csv.
My csv has no header and i used semicolons.

Kind regards,
Andreas

Am 18.01.11 11:57, schrieb Jan Vlčinský (CAD):
Hi
BaseX 6.5 incl. rewritten web site is impressive. Really.

I go through it feature by feature and test it.
Trying to import CSV file I have a problem

  1. Creation of new database from xsv file or directory does not work (using default options, no changes)
    Reports "Line 1: Content is not allowed in prolog"
  2. Adding document by Database - Add documents results in the same message
  3. Trying to SET PARSER CSV
    did not change anything
  4. Trying to add header with field names into imported file does not help
Questions
  1. How to import CSV fle
  2. What CSV format is expected
    1. tab, coma, semicolon?
    2. header with field name allowed/expected?
With best regards

Jan

_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


-- 

Andreas Weiler
Database & Information Systems Group, U Konstanz
Room E 209, 0049 7531 88 4449 (phone) 3577 (fax)
University of Konstanz



--
Ing. Jan Vlčinský
CAD programy
Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic
tel: +420-597 602 024; mob: +420-608 979 040
skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com
http://cz.linkedin.com/in/vlcinsky



-- 

Andreas Weiler
Database & Information Systems Group, U Konstanz
Room E 209, 0049 7531 88 4449 (phone) 3577 (fax)
University of Konstanz