tmontaigu / dbase-rs

Rust library to read & write dBase files.
MIT License
29 stars 30 forks source link

Ignoring certain columns of file with serde #58

Closed texasfight closed 1 year ago

texasfight commented 1 year ago

I have some .dbf files that contain a lot of junk columns from a POS system and am trying to figure out the best way to ignore those columns. If I put just the names of the columns I want, it ends up just renaming the first n columns to those names rather than plucking out those columns. Is there a way to only get the columns I want using serde rather than having to define data types for all of the columns I don't want (100+)?

Example:

File columns:

  1. a
  2. b
  3. c
  4. d

What I want:

  1. a
  2. c

Thank you in advance for your help.

tmontaigu commented 1 year ago

This is not possible, and would probably require changes to the serde implementation

The better option would be to implement your own convertion form a dbase::Record to your struct

texasfight commented 1 year ago

Got it, that was my backup plan. Thanks for your help!