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

Add option for FWF reader and writer #601

Open
bkamins opened this issue Apr 15, 2020 · 0 comments
Open

Add option for FWF reader and writer #601

bkamins opened this issue Apr 15, 2020 · 0 comments
Milestone

Comments

@bkamins
Copy link
Member

bkamins commented Apr 15, 2020

The request to handle fixed with format pops up frequently.

Here are the major points of the functionality (this is an ideal state - not all has to be implemented from the start):

  • we need reader and writer
  • for both reader and writer there be two options (both are needed in different situations)
    • byte based width counting
    • character based width counting
  • column width specification
    • both reader and writer should have an "autodetection" of fields width based on a separator passed
    • both reader and writer should have an option to be passed a sequence of integers that indicate consecutive field widths
    • both reader and writer should have an option to be passed a sequence of integers that indicate consecutive field widths (e.g. [1,2,3])
    • both reader and writer should have an option to be passed a sequence of ranges (e.g. [1:2, 5:10], overlapping ranges should error) that indicate field widths (this allows for skipping fields - writer should fill gaps with separator)
  • writer should allow to specify alignment of contents within field
  • reader should optionally strip separator when reading in strings (i.e. field " ab " should be parsed as "ab" or " ab " depending on this option)
  • consideration should be given if we allow the last column to have a different width in different rows when we use autodetection or width specified as integers (again - maybe this should be an option - either accept or throw an error)

If something is not clear please comment.

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

3 participants