Importing CSV fles (BaseX 6.5)

Tuesday, 18 January 2011 · 5 messages
JC
Jan Vlčinský (CAD)18 Jan 2011 11:57 #
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
AW
Andreas Weiler18 Jan 2011 13:41 #
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
Quoted text · Jan Vlčinský (CAD) · 33 lines
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 at 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
JC
Jan Vlčinský (CAD)18 Jan 2011 14:14 #
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 at uni-konstanz.de>
Quoted text · Andreas Weiler · 53 lines
> 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 listBaseX-Talk at mailman.uni-konstanz.dehttps://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 at gmail.com http://cz.linkedin.com/in/vlcinsky
AW
Andreas Weiler18 Jan 2011 14:50 #
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
Quoted text · Jan Vlčinský (CAD) · 98 lines
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 at uni-konstanz.de > <mailto:andreas.weiler at 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 at mailman.uni-konstanz.de <mailto:BaseX-Talk at 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 at gmail.com > <mailto:jan.vlcinsky at 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
JC
Jan Vlčinský (CAD)18 Jan 2011 15:25 #
Hi Andreas Yes, it works. I am not sure, what I did wrong before (I do not see any log file so I am unable to check, what exactly I was trying to enter). Adding parser combo to Add documents sounds as good idea. It would be practical to have also some keyboard shortcut for Add document, I would think of Ctrl-Shift-N as it is sort of New something. Jan 2011/1/18 Andreas Weiler <andreas.weiler at uni-konstanz.de>
Quoted text · Andreas Weiler · 124 lines
> 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 at 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 listBaseX-Talk at mailman.uni-konstanz.dehttps://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 at 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 > >
-- *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 at gmail.com http://cz.linkedin.com/in/vlcinsky

⚡Generated with XQuery