LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   need help to put " ' " at line... (https://www.linuxquestions.org/questions/programming-9/need-help-to-put-at-line-624531/)

DoME69 02-28-2008 12:57 PM

need help to put " ' " at line...
 
Hi

i got problem to put " ' " at some lines

input:

abc (123)
cde (654)
fff (987)

output:

abc '(123)'
cde '(654)'
fff '(987)'

i try with sed and i didnt success

angrybanana 02-28-2008 01:02 PM

What did you try?
Code:

$ sed -r "s/(\(.*\))/'\1'/" file
abc '(123)'
cde '(654)'
fff '(987)'


DoME69 02-28-2008 01:13 PM

Quote:

Originally Posted by angrybanana (Post 3072905)
What did you try?
Code:

$ sed -r "s/(\(.*\))/'\1'/" file
abc '(123)'
cde '(654)'
fff '(987)'


10x its work
:)


All times are GMT -5. The time now is 12:38 PM.