Assign a particular value to all items in a group that have the same identifier
I have a pdb file with the following format:
Between columns 61 to 66 is the value for the B-factor;
between columns 23-26 is the residue number; and
between columns 13-15 is the atom name.
I need to take the B-factor (columns 61-66) for atom CA (columns 13-15) that corresponds to each residue number (columns 23-26), and write that value down in columns 68 to 73 for all rows with the matching residue number.
The pattern always puts CA as the second atom in the group of residues, but the complication is that the number of atoms for each residue varies.
For example, for the data above, I need to have the following output:
Can anyone help me? Very much appreciated for your time.
Thanks very much! It works great.
Is it possible to have it write to a new file, rather than overwrite the current file? I tried to modify the command trivially, but couldn't get anything to work.
If not easy to do, it is fine, I can make just make two files.
Very much appreciated.
You are welcome. Yes, you can simply redirect the output to a new file
Otherwise, I am not sure if I understand what you mean. The awk script itself was not overwriting a file, it was reading the same file twice, therefore the file name needs to be specified twice.
This User Gave Thanks to Scrutinizer For This Post:
hello, i am running an AIX6.1 machine and i am trying to restore a volume group that i backed up using mkvgdata command from another server. although i checked file .data and i make sure that PP size for this volume group is 128, when i run restvg command to restore it, it fails because it... (2 Replies)
Hi Guys...
I am using the following codes in my script:
SID_L=`cat /var/opt/oracle/oratab|grep -v "^#"|cut -f1 -d: -s`
SID_VAR=$SID_L
for SID_RUN in $SID_VAR
do
ORACLE_HOME=`grep ^$SID_RUN /var/opt/oracle/oratab | \
awk -F: '{print $2}'` ;export ORACLE_HOME
export... (2 Replies)
Hi
I have already gone through this topic on this forum, but still i am getting same problem.
I am using solaris 10. my login shell is /usr/bash
i have got a script as below
/home/gyan> cat 3.cm
#!/usr/bin/ksh
export PROG_NAME=rpaa001
if i run this script as below , it works fine... (3 Replies)
I have a file in the following format. Groups of data merge together and the group number is indicated above each group.
1
adrf
dfgr
dfg
2
dfgr
dfgr
3
dfef
dfr
fd
4
fgrt
fgr
fgg
5
fgrt
fgr (3 Replies)
Hi ,
I am getting the following message when log into my unix account in sun solaris (version5.9)server.
-sh: ORACLE_HOME=/apps/oracle/product/10.2.0/client_1: is not an identifier
The ORACLE_HOME is set in .profile file.
Another thing is that SID is also set inside .profile like... (4 Replies)
OS=HP-UX ksh
The following works, except I want to include the <start> and <end> in the output.
awk -F '<start>' 'BEGIN{RS="<end>"; OFS="\n"; ORS=""} {print $2} somefile.log'
The following work in bash but not in ksh
sed -n '/^<start>/,/^<end>/{/LABEL$/!p}' somefile.log (4 Replies)