Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-30-2013
Registered User
 
Join Date: Jul 2012
Posts: 53
Thanks: 12
Thanked 2 Times in 2 Posts
[Solved] Extract a pattern using sed or cut

Hi,
Need help to extract a pattern using sed or cut or any other means.

Input

Code:
'name1',1234567890
'name2',2222222222
'name3',3333333333

Expected output

Code:
name1,1234567890
name2,2222222222
name3,3333333333

Sponsored Links
    #2  
Old 01-30-2013
Scrutinizer's Avatar
Moderator
 
Join Date: Nov 2008
Location: Amsterdam
Posts: 7,381
Thanks: 144
Thanked 1,756 Times in 1,593 Posts
extract? Just delete the quotes:

Code:
tr -d \' < file

Sponsored Links
    #3  
Old 01-30-2013
Yoda's Avatar
Jedi Master
 
Join Date: Jan 2012
Location: Galactic Empire
Posts: 2,321
Thanks: 154
Thanked 742 Times in 714 Posts

Code:
sed 's/'\''//g' filename


Code:
awk '{gsub(/'\''/,"")}1' filename

    #4  
Old 01-30-2013
Registered User
 
Join Date: Jul 2012
Posts: 53
Thanks: 12
Thanked 2 Times in 2 Posts
Thanks bipinajith,

That's what i was looking for...

Moderator's Comments:
edit by bakunin: changed thread title accordingly.

Last edited by bakunin; 01-30-2013 at 05:53 PM..
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sed or awk, cut, to extract specific data from line ocramas Shell Programming and Scripting 4 11-01-2012 12:17 AM
[Solved] deleting pattern based lines in sed pandeesh UNIX for Dummies Questions & Answers 0 12-03-2011 04:25 AM
[solved] remove pattern with sed a27wang Shell Programming and Scripting 8 09-17-2010 01:17 PM
sed: Find start of pattern and extract text to end of line, including the pattern TestTomas Shell Programming and Scripting 5 05-27-2009 11:16 AM
Please help! Sed extract a pattern zhen Shell Programming and Scripting 11 09-18-2006 12:36 PM



All times are GMT -4. The time now is 09:00 AM.