The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
print only matched string instead lines in grep anchal_khare Shell Programming and Scripting 3 02-18-2009 04:34 AM
print only last two words of a line pradeepreddy Shell Programming and Scripting 5 08-22-2008 02:23 AM
print last matched pattern using perl er_ashu Shell Programming and Scripting 5 07-23-2008 03:18 AM
SED: delete and print the only exact matched pattern new_buddy Shell Programming and Scripting 6 07-09-2008 05:19 AM
AWK - Extracting matched line not4google Shell Programming and Scripting 9 11-02-2006 11:02 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-02-2009
binnybio binnybio is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 4
Print two matched words from the same line

Hi experts

I need to pick 2 matched words from the same line.....
I have given below an example file

eg:

Code:
O14757 hsa04110 hsa04115 2 P38398 hsa04120 1 
O15111 hsa04010 hsa04210 hsa04920 hsa04620 hsa04660 hsa04662 hsa05200 hsa05212 hsa05221 hsa05220 hsa05215 hsa05222 hsa05120 13 O14920 hsa04010 hsa04210 hsa04910 hsa04920 hsa04620 hsa04660 hsa04662 hsa05200 hsa05212 hsa05221 hsa05220 hsa05215 hsa05222 hsa04930 hsa05120 15 
O15264 hsa04010 hsa04370 hsa04912 hsa04620 hsa04664 hsa04670 hsa05014 hsa05120 8 Q15139 
O15297 hsa04115 1 Q00987 hsa04120 hsa04110 hsa04115 hsa05200 hsa05214 hsa05220 hsa05218 hsa05219 hsa05215 9 
O43464 hsa05012 1 P98170 hsa04120 hsa04210 hsa04510 hsa05200 hsa05222 5

From the above file i have to pick only the 6 letter alphanumerical words(highlighted words) in the given below format

ie,

Code:
 O14757    P38398 
 O15111    O14920

Pls reply me asap

Last edited by pludi; 11-02-2009 at 06:20 AM.. Reason: code tags, please...
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0