I'm looking for a command to add a pattern before or the delimiter.

**My sting:** 

```
1 |Chris|ubuntu

```

Here my delimiter is`|` and I want to generate a string with this input.

**Output**

```
1 = ID and Chris = Name and Ubuntu = OS

```

Sometimes, my input has 2 values only.
Let's say `2 | Ram`, which has one value and no delimiter, so it should print:

```
2=ID and Ram=Name

```

So, `field1 + "and" + field2 + "and" + field3`. If field3 is not available in the input string then use `field1 + "and" + field2`.