|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
Code:
sed "s/^>[^ ]* />/" file |
| The Following User Says Thank You to anbu23 For This Useful Post: | ||
euspilapteryx (03-03-2013) | ||
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| 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 12:24 PM |
| delete first 2 characters for each line, please help | sunnydanniel | Shell Programming and Scripting | 4 | 02-11-2012 11:17 AM |
| Delete characters from each line | lost.identity | Shell Programming and Scripting | 2 | 11-15-2010 04:30 PM |
| Delete new line characters from a file | rudoraj | Shell Programming and Scripting | 4 | 04-12-2010 02:12 PM |
| delete duplicated characters in each line | ivpz | Shell Programming and Scripting | 5 | 12-22-2009 05:57 AM |
|
|