kshedden / datareader

Read binary SAS (SAS7BDAT) and Stata (dta) files in the Go (Golang) programming language. Also provides command line tools for working with these file formats.
BSD 3-Clause "New" or "Revised" License
23 stars 12 forks source link

Reader does not handle column labels. #8

Closed gmeixiong closed 5 years ago

gmeixiong commented 5 years ago

Column labels within sas files are lost with the Go reader.

kshedden commented 5 years ago

I think we do retain the labels, but under the current API there does not seem to be a way to access them (they are a non-exported field of the Colum struct, which in turn is hidden as a non-exported field of the SAS7BDATReader struct).

I will look into some minor restructuring to expose these things. It might be a few days before I can look at this though.

gmeixiong commented 5 years ago

Thanks for the quick response! This would be much appreciated! I’ll take another look and can submit a PR if the change does not look too complicated.

On Tue, Sep 24, 2019 at 6:40 PM Kerby Shedden notifications@github.com wrote:

I think we do retain the labels, but under the current API there does not seem to be a way to access them (they are a non-exported field of the Colum struct, which in turn is hidden as a non-exported field of the SAS7BDATReader struct).

I will look into some minor restructuring to expose these things. It might be a few days before I can look at this though.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kshedden/datareader/issues/8?email_source=notifications&email_token=ACJ5LOKGYXNHI534MQM7XB3QLK6SRA5CNFSM4I2FSONKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7QJ3II#issuecomment-534814113, or mute the thread https://github.com/notifications/unsubscribe-auth/ACJ5LOLSOPRRUGH23ZEOH5TQLK6SRANCNFSM4I2FSONA .

gmeixiong commented 5 years ago

I submitted a PR to include ColumnLabels and fixed a bug related to them. Please verify when you have the time.