An open API service indexing awesome lists of open source software.

https://github.com/jiro4989/gsv

gsv transforms a multi-line CSV into one-line JSON to make it easier to grep.
https://github.com/jiro4989/gsv

cli csv go grep

Last synced: 11 months ago
JSON representation

gsv transforms a multi-line CSV into one-line JSON to make it easier to grep.

Awesome Lists containing this project

README

          

= gsv
:sectnums:
:toc: left

image:https://github.com/jiro4989/gsv/actions/workflows/go-test.yml/badge.svg[test, link="https://github.com/jiro4989/gsv/actions/workflows/go-test.yml"]
image:https://codecov.io/gh/jiro4989/gsv/branch/main/graph/badge.svg[codecov, link="https://codecov.io/gh/jiro4989/gsv"]

`gsv` transforms a multi-line CSV into one-line JSON to make it easier to `grep`.
`gsv` is heavily inspired by https://github.com/tomnomnom/gron[gron].

[source,bash]
----
⟩ cat testdata/sample1.csv
Language,Word,Note
English,"Hello
World",note
Japanese,"こんにちは
こんばんは",メモ
English,"John
Rose",
Japanese,"太郎
花子",

⟩ cat testdata/sample1.csv | ./gsv
["Language","Word","Note"]
["English","Hello\nWorld","note"]
["Japanese","こんにちは\nこんばんは","メモ"]
["English","John\nRose",""]
["Japanese","太郎\n花子",""]

⟩ cat testdata/sample1.csv | ./gsv | grep Japan
["Japanese","こんにちは\nこんばんは","メモ"]
["Japanese","太郎\n花子",""]

⟩ cat testdata/sample1.csv | ./gsv | grep Japan | ./gsv -u
Japanese,"こんにちは
こんばんは",メモ
Japanese,"太郎
花子",
----

== Usage

[source,bash]
----
gsv | grep '' | gsv -u
----

== Installation

[source,bash]
----
go install github.com/jiro4989/gsv@main
----

or download executables from https://github.com/jiro4989/gsv/releases[GitHub Releases].