Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
csvutils
Advanced tools
Readme
A collection of command line CSV utilities.
npm install -g csvutils
To see available commands and options
$ csv --help
Peeking
To quickly see what's in each column
$ csv peek < input.csv
Sorting
Sort the rows by column number col_no
$ csv sort col_no < input.csv
To sort numerically, use the -n
switch. To output rows in descending order use the -d
switch
Uniques
To output rows with unique col_no
$ csv unique col_no < input.csv
Extracting a column
$ csv extract col_no < input.csv
To extract multiple columns, use $ csv extract col1 col2 colN < input.csv
Distinct Columns
To see distinct column values from col_no
$ csv extract col_no < input.csv | csv unique
Adding elements
To the start of each line
$ csv unshift element < input.csv
To the end of each line
$ csv push element < input.csv
Slicing
To input a range of lines
$ csv slice start_line end_line < input.csv
Inserting an element
$ csv insert pos element < input.csv
Replacing a column
$ csv replace pos element < input.csv
Counting lines
$ csv count < input.csv
Modifying elements
$ csv eval col_no <eval> < input.csv
E.g. remove the "," and "%" characters from column 2
$ csv eval 2 "column.replace(/[,%]/g, '')" < input.csv
If no column number is specified, the first column is eval
'd.
E.g. extract column 4 and remove non-int chars
$ csv extract 4 < input.csv | csv eval "column.replace(/[^0-9]/g,'')"
Ignoring a header line
Use the --header
switch.
Copyright (c) 2010 Chris O'Hara cohara87@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
A collection of CSV utilities
The npm package csvutils receives a total of 4 weekly downloads. As such, csvutils popularity was classified as not popular.
We found that csvutils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.