Hi fellow linux-ers,
I have a quick question for you. I have the following text, which I would like to modify:
10 121E(121) 16 Jan
34S 132E 24 Feb
42 176E(176) 18 Sep
21S 164E 25 May
15 171W(-171) 09 Jul
How can I do the following 2 modifications using sed and/or awk?
- in 1st column, if a field has an "S", delete the "S" and add a "-" in front of number
- in the 2nd column, delete the parenthesis and the number that exists within it
Thanks!!!