Reputation: 137
I have text file which contains lines as mentioned below
<property>PASSWORD_X_1</property>
<property>PASSWORD_A_2</property>
<property>PASSWORD_B_6</property>
so on so forth..
Now i am looking to change the lines to:
<property>{PASSWORD_X_1}</property>
<property>{PASSWORD_A_2}</property>
<property>{PASSWORD_B_6}</property>
I could change the initial "{" using simple sed expression:
sed -e '/PASSWORD/{PASSWORD/g'
Not able to figure out how do i append the "}" character.
Any suggestions..?
J
Upvotes: 1
Views: 245
Reputation: 1076
This should work:
awk -F"<|>" '{ print "<" $2 ">{" $3 "}<" $4 ">" }' file.text
Upvotes: 2