Hi,
I have file which contains following lines
A| 965.|Mr.|35.45| 66.
B| 33.| a456.| 77.
The output should be
A|965|Mr.|35.45|66
B|33| a456.|77
Basically if a Number has space in prefix and . in suffix remove both.
So pattern could be if there is a | which has next two characters as space and number ending with a number.| remove space and .
The line below removes dot if "number.|" pattern occurs
sed -i -e 's/\ ([0-9]\).|/\1|/g' -e 's/\ ([0-9]\).$/\1/' file
I need something to search for
"| number" and make it |number
Thanks
---------- Post updated at 05:19 PM ---------- Previous update was at 04:06 PM ----------
Hi,
I almost got what I wanted:
sed -i -e 's/\([0-9]\).|/\1|/g' -e 's/\([0-9]\).$/\1/' -e 's/|\s\([0-9]\)/|\1/g' file