Commit e7b4ac96 authored by Ian Dennis Miller's avatar Ian Dennis Miller

expand explanations

parent 807f3b27
Pipeline #11 canceled with stages
......@@ -80,28 +80,39 @@ The `csv ls` function will render the current directory as CSV format.
```
bash$ csv ls
-rw-rw-r--,1,idm,idm,3999,Oct,1,02:53,csv-pipes.sh
-rw-rw-r--,1,idm,idm,867,Oct,1,02:55,Readme.md
-rw-r--r--,1,idm,staff,1074,12,Oct,17:47,LICENSE
-rw-r--r--,1,idm,staff,54,12,Oct,17:25,Makefile
-rw-r--r--,1,idm,staff,4816,12,Oct,18:01,Readme.md
-rw-r--r--,1,idm,staff,365,12,Oct,17:25,Todo.md
-rw-r--r--,1,idm,staff,4007,12,Oct,17:25,csv-pipes.sh
```
### Obtain file listing as CSV and select file sizes
Use `csv select` to get a single column from the results.
The results of `csv ls` are piped directly to `csv select`.
The `select` command takes column index numbers as its parameters.
In this example, the results of `csv ls` are piped directly to `csv select` at which point the 9th and 5th columns are selected (in that order).
Multiple columns may be selected at once using multiple parameters.
The order in which they are selected determines the order in which they are returned.
```
bash$ csv ls | csv select 5
3999
867
bash$ csv ls | csv select 9 5
LICENSE,1074
Makefile,54
Readme.md,4755
Todo.md,365
csv-pipes.sh,4007
```
### Calculate average file size
Perform a simple calculation with the results.
Calculation the average of the file sizes.
```
bash$ csv ls | csv select 5 | csv mean
1915.66666667
2093.60000000
```
### Limit results to 5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment