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

[FEATURE] : Ability to Transform Header #287

Closed
sharathchandramg opened this issue Oct 28, 2019 · 1 comment
Closed

[FEATURE] : Ability to Transform Header #287

sharathchandramg opened this issue Oct 28, 2019 · 1 comment
Assignees
Labels
enhancement in release When a feature is merged in to the release branch
Milestone

Comments

@sharathchandramg
Copy link

I am looking at feature of transforming only the header data of my CSV file. The data import CSV files generally have human readable names, and its easier for processing if I can remap to internal names

I am currently looking at using mapKeys from lodash to transform the keys. However this needs to run for every entry.

csv
                .parseFile(req["file"].path, { headers: true, trim: true, ignoreEmpty: true, discardUnmappedColumns: true, strictColumnHandling: true })
                .on('data', row => { })
                .transform((d) => {
                    const data = formDataServiceManager.mapKeysFromDisplayToInternal(d);
                    
                })
                .on("data-invalid", (row, rowNumber) => { /*console.log("invalid")*/ })
                .on("end", (rowCount) => { return console.log("Here ") });

The renaming of headers won't work since users can change the order of the columns before uploading the data.

@doug-martin doug-martin added this to the v3.7.0 milestone Dec 19, 2019
doug-martin added a commit that referenced this issue Dec 19, 2019
* [ADDED] Ability to Transform Header #287
doug-martin added a commit that referenced this issue Dec 19, 2019
@doug-martin doug-martin added the in release When a feature is merged in to the release branch label Dec 20, 2019
@doug-martin doug-martin mentioned this issue Dec 21, 2019
@doug-martin
Copy link
Contributor

Released in v3.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement in release When a feature is merged in to the release branch
Projects
None yet
Development

No branches or pull requests

3 participants