I have a string that is always 3 characters... the first one and the last one are always the same.
example:
▁▅█
Is there a simple way to only display the one in the middle? (which is the only one that changes)
|
I have a string that is always 3 characters... the first one and the last one are always the same. example: ▁▅█ Is there a simple way to only display the one in the middle? (which is the only one that changes) |
|||
|
|
|
Yes, try doing this, and pick your preferred method =) : With grep:
With cut:
With bash parameter expansion :
With sed:
or
With perl:
With ruby:
With awk:
With python:
or
NOTE
|
|||||||||||
|
|
You could also use
This says:
Thus:
Will print:
|
||||
|
|
|
For variety, here's one way with
If your grep doesn't support perl (
These alternatives only work for one-line input. |
|||
|
|