mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-19 13:31:02 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
687f4b7bb2 | ||
| 24b66b8a6b |
12
README.md
12
README.md
@@ -11,7 +11,13 @@ ignore certain column[s] by regex, name or number. It can output the
|
|||||||
tabular data in a range of formats (see below). There's even an
|
tabular data in a range of formats (see below). There's even an
|
||||||
interactive filter/selection tool available.
|
interactive filter/selection tool available.
|
||||||
|
|
||||||
Usage:
|
## Demo
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
```default
|
```default
|
||||||
Usage:
|
Usage:
|
||||||
tablizer [regex,...] [file, ...] [flags]
|
tablizer [regex,...] [file, ...] [flags]
|
||||||
@@ -149,10 +155,6 @@ other separator, for instance: `-R '| |-|'`.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Demo
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
There are multiple ways to install **tablizer**:
|
There are multiple ways to install **tablizer**:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const DefaultSeparator string = `(\s\s+|\t)`
|
const DefaultSeparator string = `(\s\s+|\t)`
|
||||||
const Version string = "v1.5.3"
|
const Version string = "v1.5.4"
|
||||||
const MAXPARTS = 2
|
const MAXPARTS = 2
|
||||||
|
|
||||||
var DefaultConfigfile = os.Getenv("HOME") + "/.config/tablizer/config"
|
var DefaultConfigfile = os.Getenv("HOME") + "/.config/tablizer/config"
|
||||||
|
|||||||
@@ -204,8 +204,8 @@ func printASCIIData(writer io.Writer, conf cfg.Config, data *Tabdata) {
|
|||||||
Borders: tw.BorderNone,
|
Borders: tw.BorderNone,
|
||||||
Symbols: styleTSV,
|
Symbols: styleTSV,
|
||||||
Settings: tw.Settings{
|
Settings: tw.Settings{
|
||||||
Separators: tw.Separators{BetweenRows: tw.Off, BetweenColumns: tw.On},
|
Separators: tw.SeparatorsNone,
|
||||||
Lines: tw.Lines{ShowFooterLine: tw.Off, ShowHeaderLine: tw.Off},
|
Lines: tw.LinesNone,
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
tablewriter.WithConfig(tablewriter.Config{
|
tablewriter.WithConfig(tablewriter.Config{
|
||||||
@@ -213,23 +213,18 @@ func printASCIIData(writer io.Writer, conf cfg.Config, data *Tabdata) {
|
|||||||
Formatting: tw.CellFormatting{
|
Formatting: tw.CellFormatting{
|
||||||
AutoFormat: tw.Off,
|
AutoFormat: tw.Off,
|
||||||
},
|
},
|
||||||
Padding: tw.CellPadding{
|
Padding: tw.CellPadding{Global: tw.Padding{Left: "", Right: " "}},
|
||||||
Global: tw.Padding{Left: "", Right: ""},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Row: tw.CellConfig{
|
Row: tw.CellConfig{
|
||||||
Formatting: tw.CellFormatting{
|
Formatting: tw.CellFormatting{
|
||||||
AutoWrap: tw.WrapNone,
|
AutoWrap: tw.WrapNone,
|
||||||
Alignment: tw.AlignLeft,
|
Alignment: tw.AlignLeft,
|
||||||
},
|
},
|
||||||
Padding: tw.CellPadding{
|
Padding: tw.CellPadding{Global: tw.Padding{Right: " "}},
|
||||||
Global: tw.Padding{Left: "", Right: ""},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
Debug: true,
|
Debug: true,
|
||||||
}),
|
}),
|
||||||
tablewriter.WithPadding(tw.PaddingNone),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if !conf.NoHeaders {
|
if !conf.NoHeaders {
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ alpha 2013-Feb-03
|
|||||||
ceta 06/Jan/2008 15:04:05 -0700`,
|
ceta 06/Jan/2008 15:04:05 -0700`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "usecolumns",
|
name: "usecolumns2",
|
||||||
usecol: []int{2},
|
usecol: []int{2},
|
||||||
numberize: true,
|
numberize: true,
|
||||||
usecolstr: "2",
|
usecolstr: "2",
|
||||||
@@ -227,7 +227,7 @@ DURATION(2)
|
|||||||
33d12h`,
|
33d12h`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "usecolumns",
|
name: "usecolumns3",
|
||||||
usecol: []int{3},
|
usecol: []int{3},
|
||||||
numberize: true,
|
numberize: true,
|
||||||
usecolstr: "3",
|
usecolstr: "3",
|
||||||
@@ -238,7 +238,7 @@ COUNT(3)
|
|||||||
9`,
|
9`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "usecolumns",
|
name: "usecolumns4",
|
||||||
column: 0,
|
column: 0,
|
||||||
usecol: []int{1, 3},
|
usecol: []int{1, 3},
|
||||||
numberize: true,
|
numberize: true,
|
||||||
@@ -304,7 +304,8 @@ func TestPrinter(t *testing.T) {
|
|||||||
|
|
||||||
if got != exp {
|
if got != exp {
|
||||||
t.Errorf("not rendered correctly:\n+++ got:\n%s\n+++ want:\n%s",
|
t.Errorf("not rendered correctly:\n+++ got:\n%s\n+++ want:\n%s",
|
||||||
got, exp)
|
strings.ReplaceAll(got, " ", "_"),
|
||||||
|
strings.ReplaceAll(exp, " ", "_"))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user