1

Quick sed/awk question

view story
linux-howto

http://www.unix.com – Hi fellow linux-ers, I have a quick question for you. I have the following text, which I would like to modify: Code: 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? 1. in 1st column, if a field has an "S", delete the "S" and add a "-" in front of number 2. in the 2nd column, delete the parenthesis and the number that exists within it Thanks!!! Moderator's Comments: (HowTos)