![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sed question
I have a file that conatins following info
Policy1=U|guestRoom=test1idCode=5(1):!:Amenity2=U|RoomId=testrma=4(1):!:| GuestRoomAmenity1=U|guestRoomId=testguest1id^rmaCode=5(1):!:| I need it to look like this Policy1=U|guestRoom=test1idCode Amenity2=U|RoomId=testrmaCode GuestRoomAmenity1=U|guestRoomId=testguest1idrmaCode Basically need to cut out "\([0-9]\):!:" and start the remaining on the next line. I am trying to use following sed command sed -e 's/([0-9]):!:/\n/g' $FILE > $TEMP_FILE && mv $TEMP_FILE $FILE but I am not getting righ result. What I am getting is Policy1=U|guestRoom=test1idCode\nAmenity2=U|RoomId=testrmaCode... So for some reason "\n" does not work. Any ideas on what is wrong here? Thank you in advance |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|