Categorygithub.com/pinzolo/csvutil
modulepackage
0.24.0
Repository: https://github.com/pinzolo/csvutil.git
Documentation: pkg.go.dev

# README

csvutil

Build Status Coverage Status Go Report Card Godoc license

Description

CSVに対して様々な処理を行うコマンドラインツールです。
CSVの構成操作、およびダミーデータ生成が可能です。
それぞれのサブコマンドはパイプで組み合わせて利用できます。

Usage

ダミーデータ生成サンプル:

$ csvutil generate --size 5 --count 10 --header 氏名:郵便番号:住所:建物:メール | \
  csvutil name --name 氏名 | \
  csvutil address --zip-code 郵便番号 --prefecture 住所 --city 住所 --town 住所 --block-number | \
  csvutil building --column 建物 | \
  csvutil email --column メール

出力結果:

氏名,郵便番号,住所,建物,メール
土田 慶太郎,061-8035,京都府和光市西春別駅前西町42-18,プレステージ前河原1926,[email protected]
古川 篤人,468-2410,長崎県東根市御蔵島村一円16,テラスライフ1421,[email protected]
横田 姫葵,197-3356,愛知県志木市神田佐久間河岸44-12-6,ソレイユ麻生1229,[email protected]
荻野 吉文,819-3023,東京都大阪市平野区亀尾町44-24-2,グリーンエステート1727,[email protected]
森山 沙江,289-9318,岡山県大阪市東淀川区桜作42-6,グレースヴィレッジ宇和町杢所1118,[email protected]
大野 沙祈,093-0401,新潟県河北郡内灘町木興町46-10,パールレジデンス梨ケ原806,[email protected]
山崎 玲菜,065-9621,兵庫県大阪市浪速区八幡町39-18,スイートコート光町506,[email protected]
金沢 優二,201-6394,徳島県岩手郡雫石町日置野田36-10,プレステージ八森樋長421,[email protected]
松原 誠吾,877-1329,石川県吉野郡野迫川村灘38-5-10,ガーデンタワー藤河内1120,[email protected]
坂井 力也,967-7366,愛媛県大阪市西区白鳥町中津屋41,レイクパーク609,[email protected]

csvutil help で全体のヘルプを確認し、csvutil help [subcommand] で各サブコマンドの詳細なヘルプを確認してください。

Install

Releases · pinzolo/csvutil から最新の自分の環境にあったバイナリをダウンロードしてお使いください。

また、Go環境がある場合 go get でインストールできます。(Go 1.8以上)

$ go get github.com/pinzolo/csvutil/cmd/csvutil

Contribution

  1. Fork (https://github.com/pinzolo/csvutil/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request

Author

pinzolo

# Packages

No description provided by the author

# Functions

Address overwrite value of given column by dummy address.
Append empty values to end of each lines.
Blank overwrite value of given column by empty or spaces.
Building overwrite value of given column by dummy office or apartment.
Collect print collected CSV values.
Combine column(s) from CSV.
Convert CSV.
Count CSV lines.
Email overwrite value of given column by dummy email address.
Extract column(s) from CSV.
Filter value of given column.
Generate empty values CSV.
Header print headers of CSV.
Insert empty values to CSV.
Name overwrite value of given column by dummy name.
NewCSVProcessor returns new processor from reader and writer.
NewReader returns *csv.Reader for UTF8.
NewReaderWithEnc returns *csv.Reader for given encoding.
NewReadOnlyCSVProcessor returns new processor from reader.
NewWriter returns *csv.Writer for UTF8.
NewWriterWithEnc returns *csv.Writer for given encoding.
Numeric overwrite value of given column by random numbers.
Password overwrite value of given column by dummy password address.
Remove column(s) in CSV.
Size CSV lines.
Sort CSV.
Substitute value of given column.
Tail reads lines from tail.
Tel overwrite value of given column by dummy tel number.
Top reads lines from top.
UTF8BOM is bytes for byte order mark of UTF8.

# Constants

EmptyFirst is used when empty string is ordered in first.
EmptyLast is used when empty string is ordered in last.
EmptyNatural is used when empty string is ordered in natural.
SortDataTypeNumber is used when want use value as number.
SortDataTypeText is used when want use value as text.

# Variables

Version of csvutil.

# Structs

AddressOption is option holder for Address.
AppendOption is option holder for Append.
BlankOption is option holder for Blank.
BuildingOption is option holder for Building.
CollectOption is option holder for Collect.
CombineOption is option holder for Combine.
ConvertOption is option holder for Convert.
CountOption is option holder for Count.
CSVProcessor process CSV read from csv.Reader, and write to csv.Writer.
EmailOption is option holder for Email.
ExtractOption is option holder for Extract.
FilterOption is option holder for Filter.
GenerateOption is option holder for Generate.
HeaderOption is option holder for Header.
InsertOption is option holder for Insert.
NameOption is option holder for Name.
NumericOption is option holder for Numeric.
PasswordOption is option holder for Password.
RemoveOption is option holder for Remove.
SizeOption is option holder for Size.
SortOption is option holder for Sort.
SubstituteOption is option holder for Substitute.
TailOption is option holder for Tail.
TelOption is option holder for Tel.
TopOption is option holder for Top.