csv

package
v0.0.0-...-632d234 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJSON

func ToJSON(_ []string, stdin io.Reader) error
Example
package main

import (
	"strings"

	"github.com/frioux/leatherman/internal/tool/allpurpose/csv"
)

func main() {
	r := strings.NewReader("foo,bar\n1,2\n2,3")

	csv.ToJSON(nil, r)
}
Output:

{"bar":"2","foo":"1"}
{"bar":"3","foo":"2"}

func ToMarkdown

func ToMarkdown(_ []string, stdin io.Reader) error
Example
package main

import (
	"strings"

	"github.com/frioux/leatherman/internal/tool/allpurpose/csv"
)

func main() {
	r := strings.NewReader("foo,bar,baz\n1,2,3\n3,2,1")
	csv.ToMarkdown(nil, r)
}
Output:

foo | bar | baz
 --- | --- | ---
1 | 2 | 3
3 | 2 | 1

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL