Results 1 to 2 of 2
Hi,
I am using awk to manipulate files.
For each file (each chromosome) , I have been using the following commands to get the files in the right configuration:
gawk ...
- 10-05-2011 #1Just Joined!
- Join Date
- Oct 2011
- Location
- Seattle, WA
- Posts
- 5
Using awk/gawk to switch columns and replacing entires within a column
Hi,
I am using awk to manipulate files.
For each file (each chromosome) , I have been using the following commands to get the files in the right configuration:
gawk 'sub($1,1)' chr1a.map>chr1.map
which replaces the 0's in the first column to the chromosome # (here 1 for chr1 file).
gawk '{temp=$1;$1=$2;$2=temp}{print}' chr1a.ped>chr1.ped
which switches column 1 with column 2.
Is there anyway I can do it all for all 44 (22 map and 22 ped) files?
For the map files, I have tried the following which didn't work.
for ((i=1;i<=22;++i)); do cmd="gawk 'sub($1,"$i")' chr"i".map"; eval $cmd; done
Thanks for your help,
Joey
- 10-05-2011 #2Just Joined!
- Join Date
- Aug 2006
- Posts
- 12


Reply With Quote
