Documentation
¶
Overview ¶
Package horzmerge merges columns from one or more streams of data.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Merge ¶
Merge read lines from all io.Reader in sources, and build an hash of columns for every reader, interpreting data with a tabular semantic.
All hashes created in this way are then merged into a single hash and saved in a tabular format again.
Example ¶
This example show how to use horzmerge.Func()
package main
import (
"embed"
"io/fs"
_ "github.com/parrogo/horzmerge"
)
//go:embed fixtures
var fixtureRootFS embed.FS
var fixtureFS, _ = fs.Sub(fixtureRootFS, "fixtures")
// This example show how to use horzmerge.Func()
func main() {
//fmt.Println(horzmerge.Merge())
Output:
Types ¶
type InputError ¶
type InputError struct {
// contains filtered or unexported fields
}
InputError wraps an error in order to include the position of failing stream.
func (InputError) Convert ¶
func (e InputError) Convert(filenames []string) error
Convert returns an error that include the name of the file that causes the failure
type Options ¶
Options struct groups all options accepted by Merge.
Target field contains the io.Writer on which to write merged columns. When it's nil, os.Stdout is used as writer.
Empty field is a string that can be used to specify a value that will be interpreted as empty. When a cell of text contains this value (space trimmed), it cannot overwrite a previous value already set for the column, readed from one of the previous readers.