Oct 20, 2008 #1 demis001 Programmer Joined Aug 18, 2008 Messages 94 Location 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 Joined Feb 29, 2008 Messages 26 Location US Try: awk '{ORS=""; if(++n>1) print}' Upvote 0 Downvote
Oct 20, 2008 1 #3 PHV MIS Joined Nov 8, 2002 Messages 53,708 Location 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 Joined Nov 8, 2002 Messages 53,708 Location 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 Joined Aug 18, 2008 Messages 94 Location US Thanks, It works Upvote 0 Downvote
Oct 20, 2008 Thread starter #6 demis001 Programmer Joined Aug 18, 2008 Messages 94 Location US Zedlan, yours didn't work! Upvote 0 Downvote
Oct 20, 2008 #7 olded Programmer Joined Oct 27, 1998 Messages 1,065 Location US Do we have to use awk? xargs < datafile|sed 's/ //g' Upvote 0 Downvote
Oct 20, 2008 #8 Annihilannic MIS Joined Jun 22, 2000 Messages 6,317 Location AU Another cat-skinner: Code: sed -n 'H;${x;s/\n//gp;}' datafile Annihilannic. Upvote 0 Downvote