1.1.0 • Published 6 years ago
merge-convert-csv-to-json v1.1.0
merge-convert-csv-to-json
Merges all the csv files and converts it to json.
:rocket: Features
- Merge all the
CSVfiles and convert into singleJSONfile. - Merge all the
CSVfiles, convert it toJSONobject, assign it to aJSON fieldan then store it in aJSONfile. - Merge all the
CSVfiles, convert it toJSONwith every object keyedBy aJSONfield and then store it to aJSONfile. - Merge all the
CSVfiles, convert it toJSONwith every object keyedBy aJSONfield, assign the object to aJSONfield and then store it to aJSONfile. - Merge all the
CSVfiles, convert into singleJSONfile by converting string values into map by providingkeyValueSplitter,propertySplitter,keyIndex,valueIndex,fieldandpluginTypeastransfromPropertyToMap
Installation
Using NPM
npm install -g merge-convert-csv-to-jsonUsing YARN
yarn add merge-convert-csv-to-jsonOptions
--pattern pattern The pattern of the input files to process.
--keyBy propertyName The name of the property to keyby.
--assignTo propertyName The name of the property to assign the result to.
--outputTo filePath The filepath to output the result to.Usage
- Merge all the
CSVfiles and convert into singleJSONfile.merge-convert --pattern "/users/*.users.csv" --outputTo /users/merged.users.json - Merge all the
CSVfiles, convert it toJSONobject, assign it to aJSON fieldand then store it in aJSONfile.merge-convert --pattern "/users/*.users.csv" --assignTo users --outputTo /users/merged.users.json - Merge all the
CSVfiles, convert it toJSONwith every object keyedBy aJSONfield and then store it to aJSONfile.merge-convert --pattern "/users/*.users.csv" --keyBy email --outputTo /users/merged.users.json - Merge all the
CSVfiles, convert it toJSONwith every object keyedBy aJSONfield, assign the object to aJSONfield and then store it to aJSONfile.merge-convert --pattern "/users/*.users.csv" --keyBy email --assignTo users --outputTo /users/merged.users.json Merge all the
CSVfiles, convert into singleJSONfile by converting string values into map by providingkeyValueSplitter,propertySplitter,keyIndex,valueIndex,fieldandpluginTypeastransfromPropertyToMap# transformer-config.json [ { pluginType: "transformPropertyToMap", keyValueSplitter: ":", propertySplitter: ",", keyIndex: "0", valueIndex: "1", field: "groups_access" }, { pluginType: "transformPropertyToMap", keyValueSplitter: ":", propertySplitter: ",", keyIndex: "0", valueIndex: "1", field: "project_access" } ]merge-convert --pattern "/users/*.users.csv" --outputTo /users/merged.users.json --transformerConfig transformer-config.json