May 7, 2004 #1 Zahier MIS Oct 3, 2002 97 ZA Hi, I have an input file: aaaaaa bbbbbb cccccc dddddd eeeeee ffffff I'm trying to use awk to merge the lines so they'll look like: aaaaaabbbbbb ccccccdddddd eeeeeeffffff Please help
Hi, I have an input file: aaaaaa bbbbbb cccccc dddddd eeeeee ffffff I'm trying to use awk to merge the lines so they'll look like: aaaaaabbbbbb ccccccdddddd eeeeeeffffff Please help
May 7, 2004 #2 Salem Programmer Apr 29, 2003 2,455 GB Code: awk '{ getline b ; print $0 b }' file -- Upvote 0 Downvote
May 7, 2004 Thread starter #3 Zahier MIS Oct 3, 2002 97 ZA It works great. Thanks Salem!! Upvote 0 Downvote
May 12, 2004 Thread starter #4 Zahier MIS Oct 3, 2002 97 ZA Hi, When I run : awk '{ getline b ; print $0 b }' file on a SUN OS it gives different results: bbbbbb dddddd ffff instead of: aaaaaabbbbbb ccccccdddddd eeeeeeffffff Is awk not compatible on all Unix/Linux boxes? Upvote 0 Downvote
Hi, When I run : awk '{ getline b ; print $0 b }' file on a SUN OS it gives different results: bbbbbb dddddd ffff instead of: aaaaaabbbbbb ccccccdddddd eeeeeeffffff Is awk not compatible on all Unix/Linux boxes?
May 12, 2004 #5 PHV MIS Nov 8, 2002 53,708 FR Try using nawk Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
Try using nawk Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
May 12, 2004 #6 vgersh99 Programmer Jul 27, 2000 2,146 US Code: awk '{printf("%s%s", $0, (FNR%2) ? "" : "\n")}' file vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
Code: awk '{printf("%s%s", $0, (FNR%2) ? "" : "\n")}' file vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+