Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for writing MEMO #40

Open
montoyaedu opened this issue Oct 18, 2017 · 6 comments
Open

Support for writing MEMO #40

montoyaedu opened this issue Oct 18, 2017 · 6 comments
Assignees
Milestone

Comments

@montoyaedu
Copy link
Contributor

Hello,

I have a quick question.

Is writing MEMO supported?

@albfernandez albfernandez self-assigned this Oct 18, 2017
@albfernandez
Copy link
Owner

albfernandez commented Oct 18, 2017

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

@albfernandez
Copy link
Owner

Pull request are always welcome!

@albfernandez albfernandez added this to the 2.0 milestone Oct 22, 2019
@Saifytdin
Copy link

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

@albfernandez
Copy link
Owner

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

@HelmutL
Copy link

HelmutL commented Feb 29, 2024

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

@albfernandez
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants