These features would be nice to have. The current implementation cannot be extended to support all of these features in read/write mode, because with a shutdown compact, the whole file is rewritten.
1) Blank lines are fine anywhere in read-only mode. 2) We need a property to allow fixed-width fields. It is easy to implement, only the Writer needs changes. If you want to also implement fixe-width fields without separators (leaving out the pipe in your example), it would need a bit more work, both in Reader and Writer. 3) Whole line Comments can be supported in read only mode. We need to allow the comment character as a SET TABLE .. SOURCE property and skip the lines beginning with this character in the Reader. Also, the header line can be used to calculate the max field-widths and these can be checked against the size parameters for CHAR(N) and VARCHAR(N) fields, enforcing the equivalent of the system property sql.enforce_strict_size. It would be better to introduce these features together with the ability to allow end of line characters in (quoted) character fields. This feature has been frequently requested by users and a patch was supplied for this against 1.7.1, but due to lack of time, it has not been ported to 1.7.2. Dimitri, the patch author, is still around and may be able to offer some help. Fred ----- Original Message ----- From: "Blaine Simpson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 01 June 2004 16:36 Subject: [Hsqldb-developers] features for consideration for text files These features all have to do with Hsqldb reading in externally created text-files. I hand-edit text files written by other programs, and I create some entirely manually. I keep these files under change control, so it's very useful to be able to keep tracking information, historical information, and notes in the text file itself. I currently run a perl pre-processor on my text files to remove my edits and blank lines before importing them to Hsqldb. It would be nice if this could be handled by Hsqldb directly. I understand that when Hsqldb rewrites the text file, these comments, etc. will be wiped out, but it is still extremely useful to me to be able to use these features in my import source files. Does anybody else think that any of these features would be useful to the general Hsqldb public, or the opposite? (1) Safe use of blank lines. It "looks like" blank lines are ok, since the doc says that when db synces the file it replaces an ignored first line with a blank line. If blank lines are safe anywhere within an externally created text file, I'd like to know about it. (2) Trimming. I've been using shell scripts for many years that use DB flat files like value one is long |val2 |val3 |val4 val1b short |val2b long |val3b and |valu4b (where the delimiter is "|"). The reason for the extra white space is so that the files line up whether the file is viewed with an ASCII editor, catted, mored, etc. Otherwise it is a mess like this: value one is long|val2|val3|val4 val1b short|val2blong|val3b and|val4b The reason I prefer the first is that you can easily tell which value is for which field. You can't tell with the latter unless you count delimiters. This can be implemented by Java trimming each field value. (For backwards compatibility may want to have a setting to toggle the behavior, but 99% of the time you don't want values with leading or trailing whitespace in the database). (3) Comments. It would be nice if the user could specify a comment character so that you can have comment lines anywhere in the file. val1|val2|val3|val4 # Commenting out following 2 for this revision because Sam is on vacation # val11|val12|val13|val14 #val21|val22|val23|val24 val31|val32|val33|val34 -- ICF: 703-934-3692 Cell: 703-944-9317 ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ hsqldb-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hsqldb-developers ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ hsqldb-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hsqldb-developers