Skip to content

Commit

Permalink
Merge pull request #213 from noborus/ps-output
Browse files Browse the repository at this point in the history
Input for ps output changed to recommend `-iwidth`
  • Loading branch information
noborus authored Mar 18, 2023
2 parents 7156b40 + f2e03f7 commit 4692496
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,13 @@ trdsql -q test.sql
"`-`" or "`stdin`" is received from standard input instead of file name.

```console
ps | trdsql -id " " "SELECT * FROM -"
cat test.csv | trdsql "SELECT * FROM -"
```

or

```console
ps | trdsql -id " " "SELECT * FROM stdin"
cat test.csv | trdsql "SELECT * FROM stdin"
```

### 4.2. <a name='multiple-files'></a>Multiple files
Expand Down Expand Up @@ -645,7 +645,9 @@ PID,TTY,TIME,CMD
733213,pts/3,00:00:00,guesswidth
```

`-id " "` doesn't recognize well when there are spaces in the column.
`-id " "` for `CSV` also works in many cases.
But `-id " "` does not recognize spaces in columns very well.

`-iwidth` recognizes column widths and space separators.

### 4.14. <a name='raw-output'></a>Raw output
Expand Down Expand Up @@ -734,16 +736,6 @@ Melon,2
Apple,3
```

"- ih" sets the first line to column name

```console
$ ps |trdsql -ih -oh -id " " "SELECT \`PID\`, \`TTY\`, \`TIME\`, \`CMD\` FROM -"
TIME,TTY,PID,CMD
00:00:00,pts/20,3452,ps
00:00:00,pts/20,3453,trdsql
00:00:05,pts/20,15576,zsh
```

Note: the available functions and their syntax depend on the driver you have chosen (mysql or postgres or sqlite). The default one is sqlite.

### 4.18. <a name='join'></a>JOIN
Expand Down

0 comments on commit 4692496

Please sign in to comment.