How to delete text between two characters in line? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

How to delete text between two characters in line?

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-03-2013
euspilapteryx euspilapteryx is offline
Registered User
 
Join Date: Sep 2009
Last Activity: 3 March 2013, 10:25 AM EST
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
How to delete text between two characters in line?

Hi,

I have a large text file with the following format:

>gi|347545744|gb|JN204951.1| Dismorphia spio voucher 5
ATCAAATTCCTTCCTCTCCTTAAA
>gi|17544664774|gb|WN204922.32| Rodapara nigens gene region
CCGGGCAAATTCCTTCCTCTCCTTAAA
>gi|555466400|gb|SG255122.8| Bombyx mandariana genbank 3
CCGGGCAAATTCCTTCCTCTCCTTAAA

in each line, I would like the text between the ">" and the first space deleted. The text should be outputted like:

>Dismorphia spio voucher 5
ATCAAATTCCTTCCTCTCCTTAAA
>Rodapara nigens gene region
CCGGGCAAATTCCTTCCTCTCCTTAAA
>Bombyx mandariana genbank 3
CCGGGCAAATTCCTTCCTCTCCTTAAA

The lines that need to be edited all begin with ">". Is there a quick way to do this?
Sponsored Links
    #2  
Old 03-03-2013
anbu23's Avatar
anbu23 anbu23 is offline Forum Advisor  
Advisor
 
Join Date: Mar 2006
Last Activity: 18 December 2014, 8:26 AM EST
Location: Bangalore,India
Posts: 2,096
Thanks: 12
Thanked 132 Times in 127 Posts

Code:
sed "s/^>[^ ]* />/" file

The Following User Says Thank You to anbu23 For This Useful Post:
euspilapteryx (03-03-2013)
Sponsored Links
Closed Thread

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
How delete characters of specific line with sed? inaki Shell Programming and Scripting 12 10-23-2012 01:24 PM
delete first 2 characters for each line, please help sunnydanniel Shell Programming and Scripting 4 02-11-2012 12:17 PM
Delete characters from each line lost.identity Shell Programming and Scripting 2 11-15-2010 05:30 PM
Delete new line characters from a file rudoraj Shell Programming and Scripting 4 04-12-2010 03:12 PM
delete duplicated characters in each line ivpz Shell Programming and Scripting 5 12-22-2009 06:57 AM



All times are GMT -4. The time now is 04:39 AM.