Skip to content

Commit

Permalink
Merge pull request #298 from noborus/add-text-readme
Browse files Browse the repository at this point in the history
Added explanation for `-itext` in README.md
  • Loading branch information
noborus authored Dec 26, 2024
2 parents a3721bb + df39a1e commit 2b3fa1d
Showing 1 changed file with 32 additions and 11 deletions.
43 changes: 32 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ For usage as a library, please refer to the [godoc](https://pkg.go.dev/github.co
* 4.11. [JSONL(NDJSON)](#jsonl(ndjson))
* 4.12. [YAML](#yaml)
* 4.13. [TBLN](#tbln)
* 4.14. [WIDTH](#width)
* 4.15. [TEXT](#text)
* 4.16. [Raw output](#raw-output)
* 4.17. [ASCII Table & MarkDown output](#ascii-table-&-markdown-output)
* 4.18. [Vertical format output](#vertical-format-output)
* 4.14. [TEXT](#text)
* 4.15. [WIDTH](#width)
* 4.16. [TEXT](#text-1)
* 4.17. [Raw output](#raw-output)
* 4.18. [ASCII Table & MarkDown output](#ascii-table-&-markdown-output)
* 4.19. [Vertical format output](#vertical-format-output)
* 5. [SQL](#sql)
* 5.1. [SQL function](#sql-function)
* 5.2. [JOIN](#join)
Expand Down Expand Up @@ -88,7 +89,7 @@ make install

#### 1.1.1. <a name='requirements'></a>Requirements

go 1.19 or higher.
go 1.22 or higher.

### 1.2. <a name='download-binary'></a>Download binary

Expand Down Expand Up @@ -776,7 +777,27 @@ $ trdsql -otbln "SELECT c1::int as id, c2::text as name FROM test.csv"
TBLN can contain column names and type definitions.
Please refer to <https://tbln.dev/> for details of TBLN.

### 4.14. <a name='width'></a>WIDTH
### 4.14. <a name='text'></a>TEXT

`-itext` is input from TEXT.

`-itext` treats the text up to the end of the line as a single column. When combined with `-inum`, it can be used as a table with line numbers and text.

```console
$ cat sample.txt
This is a sample text.
Another line of text.
Yet another line.
```

```console
$ trdsql -itext -inum "SELECT * FROM sample.txt"
1,This is a sample text.
2,Another line of text.
3,Yet another line.
```

### 4.15. <a name='width'></a>WIDTH

`-iwidth` inputs the format specifying the width.
This is used when the header column width represents the body column width.
Expand All @@ -795,7 +816,7 @@ But `-id " "` does not recognize spaces in columns very well.

`-iwidth` recognizes column widths and space separators.

### 4.15. <a name='text'></a>TEXT
### 4.16. <a name='text-1'></a>TEXT

The `-itext` option or files with “.text”extension are in text format.

Expand Down Expand Up @@ -828,7 +849,7 @@ $ trdsql -inum "SELECT * FROM test.text"
5,c
```

### 4.16. <a name='raw-output'></a>Raw output
### 4.17. <a name='raw-output'></a>Raw output

`-oraw` is Raw Output.
It is used when "escape processing is unnecessary" in CSV output.
Expand All @@ -853,7 +874,7 @@ $ trdsql -oraw -od "\t|\t" -db pdb "SELECT * FROM test.csv"
3 | Apple
```

### 4.17. <a name='ascii-table-&-markdown-output'></a>ASCII Table & MarkDown output
### 4.18. <a name='ascii-table-&-markdown-output'></a>ASCII Table & MarkDown output

`-oat` is ASCII table output.

Expand Down Expand Up @@ -881,7 +902,7 @@ $ trdsql -omd "SELECT * FROM test.csv"

The `-onowrap` option does not wrap long columns in `at` or `md` output.

### 4.18. <a name='vertical-format-output'></a>Vertical format output
### 4.19. <a name='vertical-format-output'></a>Vertical format output

-ovf is Vertical format output("column name | value" vertically).

Expand Down

0 comments on commit 2b3fa1d

Please sign in to comment.