LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2008, 12:57 PM   #1
DoME69
Member
 
Registered: Jan 2008
Posts: 189

Rep: Reputation: 16
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
 
Old 02-28-2008, 01:02 PM   #2
angrybanana
Member
 
Registered: Oct 2003
Distribution: Archlinux
Posts: 147

Rep: Reputation: 21
What did you try?
Code:
$ sed -r "s/(\(.*\))/'\1'/" file
abc '(123)'
cde '(654)'
fff '(987)'
 
Old 02-28-2008, 01:13 PM   #3
DoME69
Member
 
Registered: Jan 2008
Posts: 189

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by angrybanana View Post
What did you try?
Code:
$ sed -r "s/(\(.*\))/'\1'/" file
abc '(123)'
cde '(654)'
fff '(987)'
10x its work
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ndiswrapper worked fine "ESSID:off/any" ??? cant put in an ssid?? fatrandy13 Linux - Wireless Networking 12 08-21-2011 11:32 PM
problems put linux on pc, "booting the kernel" hangs chuckd2 Linux - Newbie 7 08-17-2007 04:22 PM
How can I put "Wave" music files on a AUDIO CD to play in my car? Balarabay1 SUSE / openSUSE 4 05-22-2006 10:19 PM
cdrecord command-line parentheses "(" ")" coolingtower Linux - Software 1 10-28-2005 11:49 AM
Judge finally tells SCO to "put up or shut up" Capt_Caveman General 5 12-07-2003 10:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration