Programm not working on all sample


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Programm not working on all sample
# 1  
Old 11-14-2012
Programm not working on all sample

Hi all I am using following code and input to duplicate entries till next row but out is cutting some words in this sample can anybody check on his system is there any error?



Code:
awk ' { if($2 !~ /^ *$/) { a=substr($0,length($1)+1,index($0,$NF)-length($NF)); b=$NF; } print $1, a, b } ' file

Code:
BDKRB2    Actions of Nitric Oxide in the Heart
KDR    
PDE3B    
PRKG2    
RYR2    
SLC7A1    
ACSL3    Adipocytokine signaling pathway
ACSL6    
PPARA    
PRKAA1    
PRKAG2    
PRKCQ    
RXRG    
STAT3    
ABAT    Alanine and aspartate metabolism
CAD    
DARS2    
GOT1    
NARS2    
CARS    Aminoacyl-tRNA biosynthesis
DARS    
DARS2    
EPRS    
FARS2    
FARSLB    
FLJ12118    
IARS2    
LARS    
LARS2    
NARS2    
QARS    
WARS    
YARS    
AGT    ACE 2 regulates heart function
AGTR1    
FASLG    Antigen Dependent B Cell Activation
IL4    
CD74    Antigen processing and presentation
HLA-DPA1    
HLA-DPB1    
KIR2DL2

[/CODE]


My Output is cutting words to duplicate entries...please guide

Code:
BDKRB2     Actions of Nitric Oxide in the He Heart
KDR     Actions of Nitric Oxide in the He Heart
PDE3B     Actions of Nitric Oxide in the He Heart
PRKG2     Actions of Nitric Oxide in the He Heart
RYR2     Actions of Nitric Oxide in the He Heart
SLC7A1     Actions of Nitric Oxide in the He Heart
ACSL3     Adipocytokine signaling pathway
ACSL6     Adipocytokine signaling pathway
PPARA     Adipocytokine signaling pathway
PRKAA1     Adipocytokine signaling pathway
PRKAG2     Adipocytokine signaling pathway
PRKCQ     Adipocytokine signaling pathway
RXRG     Adipocytokine signaling pathway
STAT3     Adipocytokine signaling pathway
ABAT     Alanine and aspar metabolism
CAD     Alanine and aspar metabolism
DARS2     Alanine and aspar metabolism
GOT1     Alanine and aspar metabolism
NARS2     Alanine and aspar metabolism
CARS     Aminoacy biosynthesis
DARS     Aminoacy biosynthesis
DARS2     Aminoacy biosynthesis
EPRS     Aminoacy biosynthesis
FARS2     Aminoacy biosynthesis
FARSLB     Aminoacy biosynthesis
FLJ12118     Aminoacy biosynthesis
IARS2     Aminoacy biosynthesis
LARS     Aminoacy biosynthesis
LARS2     Aminoacy biosynthesis
NARS2     Aminoacy biosynthesis
QARS     Aminoacy biosynthesis
WARS     Aminoacy biosynthesis
YARS     Aminoacy biosynthesis
AGT     ACE 2 regulates he function
AGTR1     ACE 2 regulates he function
FASLG     Antigen Dependent B C Activation
IL4     Antigen Dependent B C Activation
CD74     Antigen processi presentation

# 2  
Old 11-14-2012
try:
Code:
awk '{if (NF>1) {str=substr($0,length($1)+1);print} else {sub("[ \t]*$","");print $0 str;}}' infile

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

unix shell programm(need urgent Help)

Hi guys, i am new to shell can u please explain how to get those two outputs in temp1 i have i/p like abcd edk lkg jkl loop i need o/p abcd ********* edk********** lkg *********** jkl *********** loop************ need o/p abcd *************** (2 Replies)
Discussion started by: ashokkrishna063
2 Replies

2. Shell Programming and Scripting

Problem with links programm.

Problem with links programm. Hi! I write sctipt for aytomatic checking into IE stas.html -> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <script type="text/javascript" src="newdata.submit()"></script> </head> <body... (1 Reply)
Discussion started by: beckss
1 Replies

3. Cybersecurity

Antivirus Programm for Solaris Desktop

Hello, I´m searching a antivirus solution for Solaris Desktop PC´s (Intel). Can anyone tell me more about some producer?? Thanks Volker (6 Replies)
Discussion started by: kingossi
6 Replies

4. Shell Programming and Scripting

how to view html in ksh programm

have a script in ksh called file1 #!/bin/ksh cat my.html --------------------------- and a html file hy.html can u tell me that if i execute "file1" script it will open hy.html bt here it is showing the all the tags along with text......... it should open the browser part... (2 Replies)
Discussion started by: ali560045
2 Replies

5. Shell Programming and Scripting

How to embeded programm within programm

Hi, How to embeded programme within perl programme. Shankarao (2 Replies)
Discussion started by: shankarao
2 Replies

6. Programming

how do i run am encrpyrtic programm on unix

how do i run am encrpyrtic programm on unix, (4 Replies)
Discussion started by: ghoz
4 Replies

7. Programming

run other programm

I have the programm, that says to STDERR(not to STDOUT!): "hello world!" and this programm is compiled and I have no sources. When I try to open this programm in another using C: ======================================= FILE *pp = popen("hello_to_stderr.exe", "r"); int c; string a; ... (2 Replies)
Discussion started by: shalmoo
2 Replies

8. UNIX for Dummies Questions & Answers

how can i install a programm?

Hello Friends, I have a problem with install.Can u tell me,how can i install a program?I am not a Root.n i use AIX(IBM) system.n how can i access a cdrom?I have been tried it,but didn't work.I can'n mounted(can u tell me another way or Command)? thanks all. (3 Replies)
Discussion started by: Christianto
3 Replies

9. UNIX for Dummies Questions & Answers

How can install a programm?

Hello Friends, I have a problem with install.can u tell me how can I install a programm?I use AIX(IBM) system. And how can i access cd-rom?I can't mounted,coz i am not Root.(can u tell me another Command /way)? Thanks all. (1 Reply)
Discussion started by: Christianto
1 Replies
Login or Register to Ask a Question