Skip to content

gwallet/csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

CSV - Comma Separated Value file manipulation utility

Command line clone of cut dedicated to CSV files.

Usage

csv [OPTION] [FILE|-]

If FILE is absent, or is equal to -, reads from standard input.

Options

Options Remarks
-f,--fields specify all field to output, first starts at 1
-s,--separator change the separator character, default is ','
-h,--help inline documentation

Example

Outputs few column of a CSV file

csv -f 1,5,8,42 file.csv

Outputs few column of a SCSV file

csv -s ';' -f 1,5,8,42 file.scsv

Use the output of a command with pipe

fun_stuff | csv -f 3,5,42

Installation

Building instruction

mkdir build
cd build
cmake ..

Or, quicker :

./build.sh

To test if it works :

./test.sh

Installation instruction

Once build, run the following commands as root:

cd build
make install

Or

cd build
sudo make install

Limitations

Follow the RFC 4180 by default. Further release may allow to change default separator character, in order to use a semi colon as an example.

In order to operate as fast as possible, the current implementation limits to 256 the number for fields that can be handled in the source stream. Further release may be more flexible and self scales to the number of columns in the source stream.

License

Copyright ⓒ2019, Guillaume Wallet wallet.guillaume@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.