https://github.com/oandregal/untangle-csv
Utility to untangle CSVs
https://github.com/oandregal/untangle-csv
csv
Last synced: 4 months ago
JSON representation
Utility to untangle CSVs
- Host: GitHub
- URL: https://github.com/oandregal/untangle-csv
- Owner: oandregal
- Created: 2017-02-16T13:08:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-16T16:52:18.000Z (about 9 years ago)
- Last Synced: 2025-03-12T20:33:46.270Z (about 1 year ago)
- Topics: csv
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Untangle CSV columns
This utility converts this stream:
date,"text/plain, text/html",text/plain,"text/plain, text/html, text/rtf","text/html, text/plain"
2017-02-07,1,2,3,4
2017-02-08,5,6,7,8
2017-02-09,1,0,1,0
2017-02-10,9,0,0,9
into:
date,text/plain,text/html,text/rtf
2017-02-07,10,8,3
2017-02-08,26,20,7
2017-02-09,2,2,1
2017-02-10,18,18,0
Under the hood, it adds the contents of the columns splitted. The columns not repeated will have the same contents - see the `date` column in the example.
# How to use it
Install it as a global module:
npm install -g untangle-csv
Use it UNIX-like:
cat demo.csv | untangle-csv > demo-untangled.csv
Or as a regular script:
untangle-csv demo.csv demo-untangled.csv