Is there a way to get the minimum and maximum values separately for each of the ranges reported by fp in case of fp input maps?
I could use e.g., awk to separate the columns, but the problem is with negative values, like in the example below:
-1–2 | 5
-2-0 | 10
0-1 | 3
The minus sign and the dash to separate the minimum and maximum value of the range are the same character so separating by separator is not that straightforwards (or maybe / hopefully I am missing something obvious).
Is there a way to get the minimum and maximum values separately for each of
the ranges reported by fp in case of fp input maps?
I could use e.g., awk to separate the columns, but the problem is with
negative values, like in the example below:
-1--2 | 5
-2-0 | 10
0-1 | 3
The minus sign and the dash to separate the minimum and maximum value of
the range are the same character so separating by separator is not that
straightforwards (or maybe / hopefully I am missing something obvious).
A '-' is a minus sign if it occurs at the beginning of the string or
immediately following another '-', otherwise it's a dash.
The following regexp should match the above syntax correctly:
^\(-\?[0-9]\+\)-\(-\?[0-9]\+\) *| *\([0-9]\+\) # basic RE syntax
^(-?[0-9]+)-(-?[0-9]+) *\| *([0-9]+) # extended RE syntax
Is there a way to get the minimum and maximum values separately for each of
the ranges reported by fp in case of fp input maps?
I could use e.g., awk to separate the columns, but the problem is with
negative values, like in the example below:
-1–2 | 5
-2-0 | 10
0-1 | 3
The minus sign and the dash to separate the minimum and maximum value of
the range are the same character so separating by separator is not that
straightforwards (or maybe / hopefully I am missing something obvious).
A ‘-’ is a minus sign if it occurs at the beginning of the string or
immediately following another ‘-’, otherwise it’s a dash.
The following regexp should match the above syntax correctly:
^(-?[0-9]+)-(-?[0-9]+) *| *([0-9]+) # basic RE syntax
^(-?[0-9]+)-(-?[0-9]+) *| *([0-9]+) # extended RE syntax