Oct 20, 2008 #1 demis001 Programmer Aug 18, 2008 94 US How I can concatinate >1 AAAAAAAAAAA BBBBBBBBBBBBB CCCCCCCCCCCC To get >1 AAAAAAAAAABBBBBBBBBCCCCCCCCCCC I have tried the following and it only capture the first line and stops. awk '/^>/ {print; "\t"; getline; print}' $*
How I can concatinate >1 AAAAAAAAAAA BBBBBBBBBBBBB CCCCCCCCCCCC To get >1 AAAAAAAAAABBBBBBBBBCCCCCCCCCCC I have tried the following and it only capture the first line and stops. awk '/^>/ {print; "\t"; getline; print}' $*
Oct 20, 2008 #2 codemut Programmer Feb 29, 2008 26 US Try: awk '{ORS=""; if(++n>1) print}' Upvote 0 Downvote
Oct 20, 2008 1 #3 PHV MIS Nov 8, 2002 53,708 FR awk '/^>/{if(FNR>1)print x;x="";print;next}{x=x $0}END{if(x>"")print x}' $* Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
awk '/^>/{if(FNR>1)print x;x="";print;next}{x=x $0}END{if(x>"")print x}' $* Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Oct 20, 2008 #4 PHV MIS Nov 8, 2002 53,708 FR OOps, sorry for the typo: awk '/^>/{if(NR>1)print x;x="";print;next}{x=x $0}END{if(x>"")print x}' $* Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
OOps, sorry for the typo: awk '/^>/{if(NR>1)print x;x="";print;next}{x=x $0}END{if(x>"")print x}' $* Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Oct 20, 2008 Thread starter #5 demis001 Programmer Aug 18, 2008 94 US Thanks, It works Upvote 0 Downvote
Oct 20, 2008 Thread starter #6 demis001 Programmer Aug 18, 2008 94 US Zedlan, yours didn't work! Upvote 0 Downvote
Oct 20, 2008 #7 olded Programmer Oct 27, 1998 1,065 US Do we have to use awk? xargs < datafile|sed 's/ //g' Upvote 0 Downvote
Oct 20, 2008 #8 Annihilannic MIS Jun 22, 2000 6,317 AU Another cat-skinner: Code: sed -n 'H;${x;s/\n//gp;}' datafile Annihilannic. Upvote 0 Downvote