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

Read header in file and then match the model with headers and their order, instead of statically defining field order in model #433

Open
sandip4git opened this issue Jan 20, 2024 · 0 comments

Comments

@sandip4git
Copy link

Example 1, if below file is give as a input

"RECHNUNG";"DATUM";"KUNDENNR";"DEBITORKONTO"
"12345";"04.08.2020 00:00:00";"12345";"";
"12345";"04.08.2020 00:00:00";"12345";""
"12345";"04.08.2020 00:00:00";"12345";""

Then we should have attribute [MatchHeadersToModel] on model class should result in
field order in model as
"RECHNUNG" : 1
"DATUM": 2
"KUNDENNR" : 3
"DEBITORKONTO" : 4

Example 2., if below file is give as a input

"DATUM";"RECHNUNG";"KUNDENNR";"DEBITORKONTO"
"04.08.2020 00:00:00";"12345";"12345";"";
"04.08.2020 00:00:00";"12345";"12345";""
"04.08.2020 00:00:00";"12345";"12345";""

Then we should have attribute [MatchHeadersToModel] on model class should result in
field order in model as
"DATUM": 1
"RECHNUNG" : 2
"KUNDENNR" : 3
"DEBITORKONTO" : 4

So, basically, we are reading header in file and then matching the model with headers and their order, instead of statically defining in file.

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

1 participant