Skip to content

Commit 81c4612

Browse files
committed
added selection-mix fail test
1 parent a6d8ae1 commit 81c4612

File tree

3 files changed

+7
-98
lines changed

3 files changed

+7
-98
lines changed

docs/support_api.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
11
# Scripting Tutorial
22

33

4-
# `sed`/`awk`-like streaming
4+
__{work in progress}__
55

6+
# `sed`/`awk`-like table processing
67

7-
Use `argMap` to abstract from file input argument
8-
```bash
8+
See see this [blog post](http://holgerbrandl.github.io/kotlin/2017/05/08/kscript_as_awk_substitute.html).
99

10-
## extract column
11-
kscript 'argMap(args[1]) { it.split("\t")[7] }' big-file.txt
12-
13-
## also extract column but from stdin
14-
cat big-file.txt | kscript 'argMap(args[1]) { it.split("\t")[7] }' -
15-
16-
```
17-
18-
Use `argFilter` to perform grep-lik operations
19-
```
20-
kscript 'argFilter(args[1]) { it.split("\t")[7] == "UA" }' src/test/resources/flights_head.txt
10+
Perform grep-lik operations
11+
```kscript
12+
kscript 'lines.split().filter{ it[7] == "UA" }' src/test/resources/some_flights.txt
2113
```
2214

23-
## Table processing
24-
2515
For very general table processing, we recommend [csvkit](https://csvkit.readthedocs.io). For more specific table processing you should most likely push tables through R.
2616

27-
However, for more typed dat
28-
We recommend [krangl] to crunch tables with `kscript`.
29-
30-
31-
3217

3318
## Bioinformatics
3419

examples/unit_tests.sh

Lines changed: 0 additions & 77 deletions
This file was deleted.

test/test_suite.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ assert 'echo "foo${NL}bar" | kscript "stdin.print()"' $'foo\nbar'
102102
#echo "$'foo\nbar' | kscript 'stdin.print()'
103103

104104
assert 'echo "foo${NL}bar" | kscript "stdin.print()"' $'foo\nbar'
105+
assert_statement 'echo "foo${NL}bar" | kscript "stdin.split().select(1, 2, -3)"' "" "[ERROR] Can not mix positive and negative selections" 1
105106

106107

107108

0 commit comments

Comments
 (0)