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

Is it possible to have a mapping selection based on line number ? #94

Open
cyrmont opened this issue Mar 1, 2023 · 1 comment
Open

Comments

@cyrmont
Copy link

cyrmont commented Mar 1, 2023

Is there a possibility to make a mapper selection based on the line position in the file ?

Most of the files I deal with have the first and last lines coming in a different format than the rest of the file.

So, for example, I would like to be able to tell the selector that if it's dealing with the first line then the mapper to use is the one I've declared for the header. Same with the last line considered as a footer.

Thanks.

@jehugaleahsa
Copy link
Owner

That's a really good idea. As a workaround, I am debating if you could declare an int in the outer scope and create a closure over it in the lambda, incrementing it as you read records.

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