Sponsored Content
Top Forums Shell Programming and Scripting awk how to replace specific field with new value Post 302511406 by setepo on Wednesday 6th of April 2011 05:55:26 PM
Old 04-06-2011
awk how to replace specific field with new value

I need to replace specific field (x) in a table with new value (y):


Input:

1 2 3 4
5 x 6 7
8 9 0 0


Output:

1 2 3 4
5 y 6 7
8 9 0 0


I have no idea how to do this.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to replace particular field

i have bad data for instance, the use of capital letters in the middle of the word. I identified the errors, made a list and put it in a file error_correction.txt Incorrect,Correct VeNOM,Venom nos,NOS . . . My data file looks like this: vgr,bugatti veron,,3.5,Venom,6,.......,....... (14 Replies)
Discussion started by: VGR
14 Replies

2. Shell Programming and Scripting

Awk to replace a field

Hi I am using awk to replace the 4th feild of the input line. My code is below: REP_LINE=$(echo $Line | awk -v var=$REPL_DT '{$4=var; print}') It does replaces but all words/phrases after the 4th feild are erased. Is there a way to modify the 4th feild of the input line and to have all... (7 Replies)
Discussion started by: sugan
7 Replies

3. Shell Programming and Scripting

Replace specific field on specific line sed or awk

I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work. Brief overview: I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Discussion started by: crownedzero
14 Replies

4. Shell Programming and Scripting

awk search/replace specific field, using variables for regexp & subsitution then overwrite file

Hello, I'm trying the solve the following problem. I have a file which I intend to use as a csv called master.csv The columns are separated by commas. I want to change the text on a specific row in either column 3,4,5 or 6 from xxx to yyy depending upon if column 1 matches a specified pattern.... (3 Replies)
Discussion started by: cyphex
3 Replies

5. Shell Programming and Scripting

AWK replace one field

I have some problem with this. Need to change field #3 to 5 if field #1 = A and filed #2 =B DataA C 6 T C B 4 R A B 3 T D E 5 4 I would like to do two things if statement is true, but can not get it to work. Here it prints column #3 if statement is true, and this works awk '{if... (3 Replies)
Discussion started by: Jotne
3 Replies

6. Shell Programming and Scripting

How to print with awk specific field different from specific character?

Hello, i need help with awk. I have this file: cat number DirB port 67 er_enc_out 0 er_bad_os 0 DirB port 71 er_enc_out 56 er_bad_os 0 DirB port 74 er_enc_out 0 er_bad_os 0 DirB port 75 ... (4 Replies)
Discussion started by: elilmal
4 Replies

7. UNIX for Dummies Questions & Answers

How to replace and remove few junk characters from a specific field?

I would like to remove all characters starting with "%" and ending with ")" in the 4th field - please help!! 1412007819.864 /device/services/heartbeatxx 204 0.547%!i(int=0) 0.434 0.112 1412007819.866 /device/services/heartbeatxx 204 0.547%!i(int=1) 0.423 0.123... (10 Replies)
Discussion started by: snemuk14
10 Replies

8. Shell Programming and Scripting

awk to replace a specific field in certain condition

Hi, I have a file like below PRUM,67016800 ,CC ,C1,67016800 , ,Y,Y,2 ,CK,BX,FOX ,00000001,EA,00000001,20141120 00:00:00, ,N,Y,Y,CK ABCDEF... (7 Replies)
Discussion started by: mady135
7 Replies

9. Shell Programming and Scripting

awk - how to print specific field if a string is matched

hi gurus, I would like to be able to use awk to process 1 file as such: abc 1 2 3 4 5 6 7 8 9 10 flags 1 2 4 flags 1 2 5 abc 2 3 4 5 6 7 8 9 10 11 flags 1 2 3 abc 4 5 6 7 8 9 6 7 78 89 flags 1 2 3 flags 1 2 4 flags 1 2 3 4 I would like to be able to print field 1 and 5 when the... (4 Replies)
Discussion started by: revaroo
4 Replies

10. Shell Programming and Scripting

awk to add symbol to specific field

Trying to use awk to add a . to $4. The input and output is tab-delimeted, but the awk seems to add a . in front of $5 and is space-delimeted. It seems close, but I am not able to produce the desired output. Thank you :). file chr1 948895 949015 chr1:948895-949015 ISG15 chr1 ... (1 Reply)
Discussion started by: cmccabe
1 Replies
g_membed(1)					 GROMACS suite, VERSION 4.5.4-dev-20110404-bc5695c				       g_membed(1)

NAME
g_membed - embeds a protein into a lipid bilayer VERSION 4.5.4-dev-20110404-bc5695c SYNOPSIS
g_membed -f into_mem.tpr -n index.ndx -p topol.top -o traj.trr -x traj.xtc -cpi state.cpt -cpo state.cpt -c membedded.gro -e ener.edr -g md.log -ei sam.edi -rerun rerun.xtc -table table.xvg -tablep tablep.xvg -tableb table.xvg -dhdl dhdl.xvg -field field.xvg -table table.xvg -tablep tablep.xvg -tableb table.xvg -rerun rerun.xtc -tpi tpi.xvg -tpid tpidist.xvg -ei sam.edi -eo sam.edo -j wham.gct -jo bam.gct -ffout gct.xvg -devout deviatie.xvg -runav runaver.xvg -px pullx.xvg -pf pullf.xvg -mtx nm.mtx -dn dipole.ndx -multidir rundir -[no]h -[no]version -nice int -deffnm string -xvg enum -xyinit real -xyend real -zinit real -zend real -nxy int -nz int -rad real -pieces int -[no]asymmetry -ndiff int -maxwarn int -[no]compact -[no]v DESCRIPTION
g_membed embeds a membrane protein into an equilibrated lipid bilayer at the position and orientation specified by the user. SHORT MANUAL ------------ The user should merge the structure files of the protein and membrane (+solvent), creating a single structure file with the protein over- lapping the membrane at the desired position and orientation. The box size is taken from the membrane structure file. The corresponding topology files should also be merged. Consecutively, create a .tpr file (input for g_membed) from these files,with the following options included in the .mdp file. - integrator = md - energygrp = Protein (or other group that you want to insert) - freezegrps = Protein - freezedim = Y Y Y - energygrp_excl = Protein Protein The output is a structure file containing the protein embedded in the membrane. If a topology file is provided, the number of lipid and solvent molecules will be updated to match the new structure file. For a more extensive manual see Wolf et al, J Comp Chem 31 (2010) 2169-2174, Appendix. SHORT METHOD DESCRIPTION ------------------------ 1. The protein is resized around its center of mass by a factor -xy in the xy-plane (the membrane plane) and a factor -z in the z-direc- tion (if the size of the protein in the z-direction is the same or smaller than the width of the membrane, a -z value larger than 1 can prevent that the protein will be enveloped by the lipids). 2. All lipid and solvent molecules overlapping with the resized protein are removed. All intraprotein interactions are turned off to pre- vent numerical issues for small values of -xy or -z 3. One md step is performed. 4. The resize factor ( -xy or -z) is incremented by a small amount ((1-xy)/nxy or (1-z)/nz) and the protein is resized again around its center of mass. The resize factor for the xy-plane is incremented first. The resize factor for the z-direction is not changed until the -xy factor is 1 (thus after -nxy iterations). 5. Repeat step 3 and 4 until the protein reaches its original size ( -nxy + -nz iterations). For a more extensive method description see Wolf et al, J Comp Chem, 31 (2010) 2169-2174. NOTE ---- - Protein can be any molecule you want to insert in the membrane. - It is recommended to perform a short equilibration run after the embedding (see Wolf et al, J Comp Chem 31 (2010) 2169-2174), to re-equilibrate the membrane. Clearly protein equilibration might require longer. FILES
-f into_mem.tpr Input Run input file: tpr tpb tpa -n index.ndx Input, Opt. Index file -p topol.top In/Out, Opt. Topology file -o traj.trr Output Full precision trajectory: trr trj cpt -x traj.xtc Output, Opt. Compressed trajectory (portable xdr format) -cpi state.cpt Input, Opt. Checkpoint file -cpo state.cpt Output, Opt. Checkpoint file -c membedded.gro Output Structure file: gro g96 pdb etc. -e ener.edr Output Energy file -g md.log Output Log file -ei sam.edi Input, Opt. ED sampling input -rerun rerun.xtc Input, Opt. Trajectory: xtc trr trj gro g96 pdb cpt -table table.xvg Input, Opt. xvgr/xmgr file -tablep tablep.xvg Input, Opt. xvgr/xmgr file -tableb table.xvg Input, Opt. xvgr/xmgr file -dhdl dhdl.xvg Output, Opt. xvgr/xmgr file -field field.xvg Output, Opt. xvgr/xmgr file -table table.xvg Input, Opt. xvgr/xmgr file -tablep tablep.xvg Input, Opt. xvgr/xmgr file -tableb table.xvg Input, Opt. xvgr/xmgr file -rerun rerun.xtc Input, Opt. Trajectory: xtc trr trj gro g96 pdb cpt -tpi tpi.xvg Output, Opt. xvgr/xmgr file -tpid tpidist.xvg Output, Opt. xvgr/xmgr file -ei sam.edi Input, Opt. ED sampling input -eo sam.edo Output, Opt. ED sampling output -j wham.gct Input, Opt. General coupling stuff -jo bam.gct Output, Opt. General coupling stuff -ffout gct.xvg Output, Opt. xvgr/xmgr file -devout deviatie.xvg Output, Opt. xvgr/xmgr file -runav runaver.xvg Output, Opt. xvgr/xmgr file -px pullx.xvg Output, Opt. xvgr/xmgr file -pf pullf.xvg Output, Opt. xvgr/xmgr file -mtx nm.mtx Output, Opt. Hessian matrix -dn dipole.ndx Output, Opt. Index file -multidir rundir Input, Opt., Mult. Run directory OTHER OPTIONS
-[no]hno Print help info and quit -[no]versionno Print version info and quit -nice int 0 Set the nicelevel -deffnm string Set the default filename for all file options -xvg enum xmgrace xvg plot formatting: xmgrace, xmgr or none -xyinit real 0.5 Resize factor for the protein in the xy dimension before starting embedding -xyend real 1 Final resize factor in the xy dimension -zinit real 1 Resize factor for the protein in the z dimension before starting embedding -zend real 1 Final resize faction in the z dimension -nxy int 1000 Number of iteration for the xy dimension -nz int 0 Number of iterations for the z dimension -rad real 0.22 Probe radius to check for overlap between the group to embed and the membrane -pieces int 1 Perform piecewise resize. Select parts of the group to insert and resize these with respect to their own geometrical center. -[no]asymmetryno Allow asymmetric insertion, i.e. the number of lipids removed from the upper and lower leaflet will not be checked. -ndiff int 0 Number of lipids that will additionally be removed from the lower (negative number) or upper (positive number) membrane leaflet. -maxwarn int 0 Maximum number of warning allowed -[no]compactyes Write a compact log file -[no]vno Be loud and noisy SEE ALSO
gromacs(7) More information about GROMACS is available at <http://www.gromacs.org/>. Mon 4 Apr 2011 g_membed(1)
All times are GMT -4. The time now is 05:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy