Question: Input:

```
blahŤfoobar1Ťblah

```

Desired output:

```
foobar1

```

I want to get the text between two "Ť" characters.

Assume there will always be either 0 or 2 "Ť" characters, to make things easier.

I tried the following, but I don't know how to get it to know which occurrence it is:

```
echo "blahŤfoobar1Ťblah" | sed -n '/Ť/,/Ť/p'

```

Answer: 
You can use a cut command. 

To extract the second pattern:

`echo "blah@foobar1@blah" | cut -f2 -d"@"`

To extract the second and third patterns:

`echo "blah@foobar1@blah" | cut -f2,3 -d"@"`

To extract from the second pattern onwards

`echo "blah@foobar1@blah" | cut -f2- -d"@"`

EDIT: Since the question was tagged with awk. Here is an awk solution.

```
echo "blah@foobar1@blah" | awk -F'@' {'print $2'}

```
`awk` likes these things:

```
$ awk -F"Ť" '{print $2}' <<< "blahŤfoobar1Ťblah"
foobar1

```

By using `Ť` as field separator, we make sure we catch the desired text in the second block. If we would like to skip the processing if no `Ť` is found in a given line, we could use `awk -F"Ť" 'NF>1{print $2}'`.

---

Regarding your attempt not working: by saying `sed -n '/start/,/end/p'` your are printing those lines that are between (and included) a line containing `start` and another containing `end`. So it would work if you wanted this.

### Example

Given this file:

```
$ cat a
starting...
Ť
foobar1
hello
Ť
i am here

```

The output is:

```
$ sed -n '/Ť/,/Ť/p' a
Ť
foobar1
hello
Ť

```