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

CSV export data types #231

Open
basgys opened this issue Feb 8, 2021 · 1 comment
Open

CSV export data types #231

basgys opened this issue Feb 8, 2021 · 1 comment
Labels

Comments

@basgys
Copy link
Contributor

basgys commented Feb 8, 2021

Hi @evanmiller,

I would like to improve the CSV conversion. Currently dates are exported as integers, and I am even wondering whether I introduced a regression on my last PR.

Could you point me in the right direction to improve the CSV export?

From what I understand, it is handled by this function: /src/bin/write/mod_csv.c#L101

Do you think we could we could reuse the metadata extraction implemented? /src/bin/extract_metadata.c#L90

I remember you mentioned metadata extraction that should be centralized, because right now we have some bits in ReadStat and bits in extract_metadata.

Let me know how I should approach this problem.

@evanmiller
Copy link
Contributor

Yep that's the place for it. Basically, CSV is generated in a streaming fashion directly from the ReadStat value handler. Since none of the date stuff is cross-format you'll most likely need to check the underlying file format and then see if the provided format looks like a date format (that's what the simplistic EDATE40 check is doing). Likely the metadata extraction functions could be reused but I haven't looked at it closely.

@evanmiller evanmiller added the CLI label Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants