csvcleaner is a command line application for manipulating csv data with markup language elements or entities, url encoded string data, and escaped strings into human readable text.
csvcleaner has poor test coverage and is not intended for use in other projects at this time. csvcleaner is for quickly fixing some very specific problems with csv data from a csv file via the command line.
After: Sam and Bob
Before: <font face=""Verdana, Arial, Helvetica, sans-serif"" size=""2"">Yes.
After: Failure to...
Before: Apostropheâ€™s, â€œDouble quotesâ€, â€˜single quotesâ€™, enâ€”dash, emâ€“dash, hyphen (â€¢)â€¦
After: Apostrophe's, "Double quotes", 'single quotes', en-dash, em-dash, hyphen (-)…
Note: Only use the option to find/replace mis-encoded characters if you actually have mis-encoded characters. Do not examine your csv data in Excel to determine if you have misencoded characters
csvcleaner requires node.js. To install:
npm install csvcleaner -g
It is also possible to incorporate csvcleaner in other projects. However, csvcleaner is intended for use as a command line tool. csvcleaner always reads from a file and writes to a new file. To add to a project:
npm install csvcleaner --save
Applies default processing to all columns and rows.
csvcleaner ~/bad-csv-data.csv ./fixed-csv-data.csv
Note: CSV cleaner will not save over an existing file via the command line. You must specify a new file to send your fixed csv data to.
Applies default processing to specified columns.
<infile> <outfile> [columns...]
csvcleaner ~/bad-csv-data.csv ./fixed-csv-data.csv ColumnA ColumnB
<infile> <outfile> [options...]
Applies optional processing to all columns
csvcleaner ~/bad-csv-data.csv ./fixed-csv-data.csv -c
Note: You can also specify specific columns to processes with option flags.