javadbf icon indicating copy to clipboard operation
javadbf copied to clipboard

Support for writing MEMO

Open montoyaedu opened this issue 7 years ago • 6 comments

Hello,

I have a quick question.

Is writing MEMO supported?

montoyaedu avatar Oct 18 '17 15:10 montoyaedu

Memo writting is not supported. At the moment javadbf is mainly oriented on reading dbfs

albfernandez avatar Oct 18 '17 17:10 albfernandez

Pull request are always welcome!

albfernandez avatar Sep 26 '19 13:09 albfernandez

Do you have plans to make writing MEMO available any soon in javadbf? Thanks!

Saifytdin avatar Oct 19 '20 22:10 Saifytdin

Do you have plans to make writing MEMO available any soon in javadbf? Thanks!

Sorry, I've no plans to improve writing support anytime soon. Pull request are always welcome

albfernandez avatar Oct 24 '20 16:10 albfernandez

I wrote a "quick and dirty" class DBFWrite2 (derived from DBFWRITE) to make it possible. It certainly would need a better integration to javadbf and error checking.

To achieve this, I had to do some modifications in existing modules:

DBFMemoFile:
allow write access („r“ → „rw“)
routines to write the memo field
in close() set next free position

DBFField:
allow write for MEMO fields

DBFHeader:
getMdxFlag()
setMdxFlag()                       set the type of CDX index (byte 28)

setSignature()                    file type (byte 0)

I am setting the field displacement in the record from outside, like: // set displacement of field within record int disp = 1; for (int i = 1; i < fields.length; i++) { disp += fields[i-1].getLength(); fields[i].setDisplacement(disp); }

Most probably, this should be integrated into DBFWriter.setFields() DBFWriter2.zip

HelmutL avatar Feb 29 '24 07:02 HelmutL

Thanks for your help. I'll review your code and try to include in the next release.

albfernandez avatar Feb 29 '24 22:02 albfernandez