![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Combining files horizontally | anshuljain | HP-UX | 3 | 03-14-2008 05:51 AM |
| how to merge these two files? | fedora | Shell Programming and Scripting | 3 | 02-12-2008 06:45 PM |
| merge files | koti_rama | Shell Programming and Scripting | 5 | 12-24-2007 10:59 PM |
| use of sed over cat to merge files | miwinter | UNIX for Advanced & Expert Users | 2 | 11-28-2007 01:36 PM |
| help in merge files | u263066 | Shell Programming and Scripting | 5 | 07-24-2006 03:24 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
merge two files horizontally
Hi all,
I have two files -- one with 1024 lines and another with 2048 lines. I want to merge them to create another file in such way that it takes 2 lines from file with 1024 lines and 4 from 2048 lines. I wrote a sample script and curious to see if there is a better way; i am sure there is, what will so many genious ppl Code:
#!/bin/ksh
i=1
j=1
while [[ $i -lt 1025 || $j -lt 2049 ]]
do
awk "NR==$i,NR==$i+1" wa1009wd00FF.dat >> final_writeFFFFh.txt
awk "NR==$j,NR==$j+3" writeFFFFh_to_dpram.txt >> final_writeFFFFh.txt
let i=i+2
let j=j+4
done
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|