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

Make fixed length metadata available #55

Open
dmichalski opened this issue Jun 2, 2020 · 4 comments
Open

Make fixed length metadata available #55

dmichalski opened this issue Jun 2, 2020 · 4 comments

Comments

@dmichalski
Copy link

Hi,

I have a use case where I read a file with fixed length columns and write some of the rows back into another file (with same format). I can't use getRawdata() as the memory footprint would be too high.

My problem now is that whenever I access a column which is filled with blanks in the input file it is treated as empty and therefore the output row becomes shorter than the original. E.g.::

Mapping:

<PZMAP> <COLUMN name="ColA" length="4" /> <COLUMN name="ColB" length="4" /> <COLUMN name="ColC" length="4" /> </PZMAP>
Input:
AAAA CCCC

Output (getString("ColA") + getString("ColB") + getString("ColC")):
AAAACCCC

If I would know the metadata of the col (as defined e.g. in the metaData attribute in the RwoRecord) a possible workaround would be to use String getString(String var1, Supplier<String> var2);. Of course an extension to getString to do the filling automatically would be even greater imho.

So questions are:

  1. Am I missing something out? Is there functionality to do what I want?

  2. Is there a reason for the metasata not accessible?

Greetings,

Dennis

@benoitx
Copy link
Contributor

benoitx commented Jun 2, 2020 via email

@dmichalski
Copy link
Author

dmichalski commented Jun 2, 2020 via email

@benoitx
Copy link
Contributor

benoitx commented Jun 2, 2020 via email

@dmichalski
Copy link
Author

Ok. As I said it is not really a problem, more a lack of feature and the implementation of the feature could be discussed. But anyway I wrote tests for two ideas how to do it.

Hope that helps...

FixedLengthStringRetrievalTest.java.txt

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

No branches or pull requests

2 participants