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 there a way to specify start and stop col_positions instead of widths ? #1

Open
jimbrig opened this issue Mar 5, 2020 · 4 comments

Comments

@jimbrig
Copy link

jimbrig commented Mar 5, 2020

sometimes i need to skip certain columns so widths dont work correctly

@prontog
Copy link
Owner

prontog commented Mar 6, 2020

Hello,

As I can tell you are using the read_multi_fwf function. It uses fwf_widths. Perhaps it would be better to accect a col_positions object and let the user decide which one to use. This is what tried to do with the read.multi.fwf function. It seems with the read_multi_fwf I missed that.

I will try to update it before the end of March.

Thanks

@prontog prontog added this to TODO in multifwf Mar 6, 2020
@jimbrig
Copy link
Author

jimbrig commented Mar 6, 2020

@prontog thanks for the reply. I could also try supplying widths with negatives for the widths on undesired columns. I'll let you know if it works. Good function by the way, surprised there isn't more similar functionalities out there...

@jimbrig
Copy link
Author

jimbrig commented Mar 6, 2020

@prontog Just submitted a PR.

I did not add any tests but I did test it out locally on a project I am working on and it worked great !

@prontog
Copy link
Owner

prontog commented Mar 6, 2020

@jimbrig2011 you mean that the negative width works with readr::read_fwf? I thought it only worked with read.fwf. Nice. Will take a look on your PR ASAP.

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

No branches or pull requests

2 participants