07-30-2007
to print output using shell command
suppose u have 2 files ; where both files have one line in common.
say one file like that
Code :
>gi|62859953|ref|NP_001017322.1| plexin B2 [Xenopus tropicalis]
MKEKERTKAITEIYLTRLLSVKGTLQQFVDNFFQSVLNSNQVVPPAVKYFFDFLDEQAEKYEIKDEDTVHIWKTNSLSLR
FWVNILKNPHFIFDVHVHQVVDASLSVIAQTFMDACSRTEHKLSRESPSNKLLYAKEISTYKKMVEDYYKGIRQMVQVSD
QDMNTHLAEISRAHTESLNTLVALHQLYQYTNKYYDEIINALEEDPAAQRMQLAYRLQQIAAALENKVTDL
>gi|114670186|ref|XP_001165971.1| PREDICTED: similar to KIAA0822 protein isoform 5 [Pan troglodytes]
MRKRKISVCQQTWALLCKNFLKKWRMKRESLMEWLNSLLLLLCLYIYPHSHQVNDFSSLLTMDLGRVDTFNESRFSVVYT
PVTNTTQQIMNKVASIPFLAGKEVLGLPDEESIKEFTANYPEEIVRVTFTNTYSYHLKFLLGHGMPAKKEHKDHTAHCYE
TNEDVYCEVSVFWKEGFVALQAAINAAIIEITTNHSVMEELMSVTGKNMKMHSFIGQSGVITDLYLFSCLISFSSFIYYA
SVNVTRERKRMKGLMTMMGLRDSAFWLSWGLLYAGFIFIMALFLALVIKSTQFIILSGFMVVFSLFLLYGLSLVALAFLM
SILVKKSFLTGLVVFLLTVFWGCLGFTSLYRHLPASLEWILSLLSPFAFMLGMAQLVHLDYDLNSNAFPHPSDGSNLIVA
>gi|149723613|ref|XP_001494133.1| PREDICTED: similar to ABCA8 protein [Equus caballus]
MSKREISVCQQTWALLCKNFLKKWRMKREPLLEWLNSFLLLLCLYLYPNNHQLNDFSSLPTMDLGRVDSFNESKFAIAYT
PVTNTTQQIMNKVASASFMKDREVLGLPDEESIKELTANYPEEIVRVIFTNTFSYHLKFLLGHRIPTKKEHRDHTAHCYE
TIEDIDCEVSEFWKKGFVALQAAINAAIIEITTNHSVMEKLMSVTGKNMKIYPFVSQGGVFTDFFVFFCIISFSPFTYYA
SVNVTRERKRMKRMMTMMGLRDSAFWLSWGLLYASFIFIMAFFLTLVIKSVQFVILTGVMVVFTLFLLYGLSLVTLAFLM
SVLIKKSFLTGLVVFLLTVFWGSLGFMALYRNLPASLEWMLSLFSPFAFTLGMSQLLHLDYDLNSNAFPDPSDLSNLIIA
>gi|73965429|ref|XP_548020.2| PREDICTED: similar to ATP-binding cassette, sub-family A member 8 [Canis familiaris]
MTKRQISVCQQTWALFCKNLLKKWRMRRESFMEWFNPLLLLLCLYLFPTNHKVNDFSSLPDMDLGPVDSFKDSLFSIVYT
PITNTTQQIMDKVALASFMKDKKVLGLSNEESIKEVMTHYPEEIIQVIFTNTFSYHLKFTLGHRIPTRREHRDHEAHCYN
LSEGVKCQVSKYWKQGFVALQAAINAAIIETTTNHSVMEELMSVTGKNMKIHPFIRQGGIVADFFIFFCIISFSSFTYYA
SINVTRERKKMKVLMKMMGLRDSAFWLSWGLLYAVFIFIMALFLALIIKSVQFVILTGFMAIFTLFFLYGLSLIALAFLM
SVLVKKSFLTGLIVFLLTIFWGSLGFTALYRHLPTSLEWILSFLSPFAFSLGMAQLLHLDYDLNSNAFPYPSDDSKLIIA
TNFMLAFDLFFYVALTIYFEKILPNEHGHEYPPLFFLKPSFWSRQHKADHVALEDEIDSNPSSNDSFEPMPPEFHGKEAI
contuining so many list of proteins as very big file
so another file just have input
1.>ref|XP_001165971.1| PREDICTED: similar to KIAA0822 protein isoform 5 [Pan troglodytes]
2.>ref|XP_001494133.1| PREDICTED: similar to ABCA8 protein [Equus caballus]
3. >ref|XP_001082492.1| PREDICTED: similar to ATP-binding cassette, sub-family A member 8[Macaca mulatta]
so have a output like that
with using 2nd file to search the first file and extract and so have a output like that
>ref|XP_001165971.1| PREDICTED: similar to KIAA0822 protein isoform 5 [Pan troglodytes]
MRKRKISVCQQTWALLCKNFLKKWRMKRESLMEWLNSLLLLLCLYIYPHSHQVNDFSSLLTMDLGRVDTFNESRFSVVYT
PVTNTTQQIMNKVASIPFLAGKEVLGLPDEESIKEFTANYPEEIVRVTFTNTYSYHLKFLLGHGMPAKKEHKDHTAHCYE
TNEDVYCEVSVFWKEGFVALQAAINAAIIEITTNHSVMEELMSVTGKNMKMHSFIGQSGVITDLYLFSCLISFSSFIYYA
SVNVTRERKRMKGLMTMMGLRDSAFWLSWGLLYAGFIFIMALFLALVIKSTQFIILSGFMVVFSLFLLYGLSLVALAFLM
SILVK
>gi|149723613|ref|XP_001494133.1| PREDICTED: similar to ABCA8 protein [Equus caballus]
MSKREISVCQQTWALLCKNFLKKWRMKREPLLEWLNSFLLLLCLYLYPNNHQLNDFSSLPTMDLGRVDSFNESKFAIAYT
PVTNTTQQIMNKVASASFMKDREVLGLPDEESIKELTANYPEEIVRVIFTNTFSYHLKFLLGHRIPTKKEHRDHTAHCYE
TIEDIDCEVSEFWKKGFVALQAAINAAIIEITTNHSVMEKLMSVTGKNMKIYPFVSQGGVFTDFFVFFCIISFSPFTYYA
SVNVTRERKRMKRMMTMMGLRDSAFWLSWGLLYASFIFIMAFFLTLVIKSVQFVILTGVMVVFTLFLLYGLSLVTLAFLM
SVLIKKSFLTGLVVFLLTVFWGSLGFMALYRNLPASLEWMLSLFSPFAFTLGMSQLLHLDYDLNSNAFPDPSDLSNLIIA
KSFLTGLVVFLLTVFWGCLGFTSLYRHLPASLEWILSLLSPFAFMLGMAQLVHLDYDLNSNAFPHPSDGSNLIVA
>gi|109117480|ref|XP_001082492.1| PREDICTED: similar to ATP-binding cassette, sub-family A member 8 isoform 2 [Macaca mulatta]
MRKREISVCQQTWALLCKNFLKKWRMKRESLMEWLNSFLLLLCLYIYPHSHQVNDFSSLLTTDLGRVDTFNESRFSVAYT
PVTNTTQQIMNKVASAPFLAGKEVLGLPDEESIKEFTANYPEEIVRVIFTNTYSYQLKFLLGHEMPAKKEHKDHTAHCYE
TNEDVYCEVSVFWKEGFVALQAAINAAIIEITTNHSVMEELMSVTGKNMKMHSFIGQSGVITDLYLFSCIISFSPFIYYA
SVNVTRERKRMKGLMTMMGLRDSAFWLSWGLLYAGFIFIMALFLALVIKSTLFIILSGFMVVFSLFLLYGLSLIALAFLM
SILVKKSFLTGLVVFLLTVFWGSLGFTALYRYLPASLEWILSLLSPFAFMLGMAQLLHLDYDLNSNAFPHPLDGSNIIVA
TNFMLAFDTCLYLALAIYFEKILPNEYGHRRSPLFFLKSSFWSQTQKADHVALEDEMDADPSSHDSFEPVPPEFHGKEAI
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I know awk command can do it, but can we use tr command to print 5th column of out put 'ls -l' command????
Regards,
Nidhi... (4 Replies)
Discussion started by: Nidhi2177
4 Replies
2. Shell Programming and Scripting
Suppose u have a file like
1 30
ABCSAAHSNJQJALBALMKAANKAMLAMALK
4562676268836826826868268468368282972982
2863923792102370179372012792701739729291
31 60... (8 Replies)
Discussion started by: cdfd123
8 Replies
3. Shell Programming and Scripting
how can i print the output of the shell script in bigger size
eg: echo " hello world"
i want to print this in the output with bigger size in the middle of the screen.
can someone please help me out in that (2 Replies)
Discussion started by: mail2sant
2 Replies
4. Shell Programming and Scripting
half of the problem is already solved with the help of bartus11 suggestion
I have a txt file having rows and coulmns, i want to perform some operation on a specific coulmn starting from a specific line.
50.000000 1 1 1
1000.00000
1000.00000
... (5 Replies)
Discussion started by: shashi792
5 Replies
5. Shell Programming and Scripting
i have written a simple script to print the out of a command and send an mail but i am not getting a shell output here .please see my script
present output is like this i need an output as same as shell
Postfix log summaries for Jan 24 Grand Totals ------------ messages 1432 received 1439... (2 Replies)
Discussion started by: unimaxlin
2 Replies
6. AIX
HI All,
I am using grep command to serach a pattern in a list of files and storing the output in a variable. Then i am applying some logic on that variable to get the required output.
But Thing is that when the pattern is present mutiple times in a file, i am getting the output of grep in a... (3 Replies)
Discussion started by: goutam sahoo
3 Replies
7. UNIX for Dummies Questions & Answers
I have this output from a loop
a11
1,2
3,4
5,6
7,8
12,8
5,4
3,6
a12
10,11
12,13
15,18
20,22
a13
... (3 Replies)
Discussion started by: maryre89
3 Replies
8. Shell Programming and Scripting
HI,
I want to connect to database and fetch the count from a table.
The sql query is as below :
select count(*) from table_test where test_column='read';
How can I print the output of this statement using shell script.
Thanks in advance. (4 Replies)
Discussion started by: confused_info
4 Replies
9. Shell Programming and Scripting
#! /bin/ksh
#] && . ./.profile 2>/dev/null
if test -f '.profile'; then . ./.profile; fi;
#. .profile
LOG_DIR=/app/rpx/jobs/scripts/just/logs
sendEmail()
{
pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7"
(
... (4 Replies)
Discussion started by: ankit.mca.aaidu
4 Replies
10. Shell Programming and Scripting
Hi Team,
Need shell script to Telnet multiple node , Ping some IP and print output like pass or fail.
Need this script to check reachability of multiple nodes at same time.
Help me.
I use this but not working...
Eg.
in this script i need to telnet... (4 Replies)
Discussion started by: Ganesh Mankar
4 Replies