prontog / multifwf

Read a table of fixed width formatted data of different types into a data.frame for each type.
GNU General Public License v3.0
1 stars 0 forks source link

is there a way to specify start and stop col_positions instead of widths ? #1

Open jimbrig opened 4 years ago

jimbrig commented 4 years ago

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

prontog commented 4 years ago

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

jimbrig commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

@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.