I'm looking for a command to add a pattern before or the delimiter.
Here my delimiter is
| and I want to generate a string with this input.
1 = ID and Chris = Name and Ubuntu = OS
Sometimes, my input has 2 values only.
2 | Ram, which has one value and no delimiter, so it should print:
2=ID and Ram=Name
field1 + "and" + field2 + "and" + field3. If field3 is not available in the input string then use
field1 + "and" + field2.