Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Grep or awk a unique and specific word across many fields Post 302999303 by RudiC on Friday 16th of June 2017 03:53:27 PM
Old 06-16-2017
You mean ONE or more homo AND NO hetero or NO homo AND ONE or more hetero? Then, yes, that's how you do it.
I have to admit, using >= 2 (or, in your second case, 1 ) would make the logics way clearer. I might adapt to that in the future...
This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep a word from a specific line

for example: searches only for single word for single word this is line three match=$(grep -n -e "single" data.txt) this command will stored "..... single ...... single" into search. how can i grep the single word just from line 2 only?? (3 Replies)
Discussion started by: blurboy
3 Replies

2. Shell Programming and Scripting

Grep out specific word and only that word

ok, so this is proving to be kind of difficult even though it should not be. say for instance I want to grep out ONLY the word fkafal from the below output, how do I do it? echo ajfjf fjfjf iafjga fkafal foeref afoafahfia | grep -w "fkafal" If i run the above command, i get back all the... (4 Replies)
Discussion started by: SkySmart
4 Replies

3. Shell Programming and Scripting

Compare Tab Separated Field with AWK to all and print lines of unique fields.

Hi. I have a tab separated file that has a couple nearly identical lines. When doing: sort file | uniq > file.new It passes through the nearly identical lines because, well, they still are unique. a) I want to look only at field x for uniqueness and if the content in field x is the... (1 Reply)
Discussion started by: rocket_dog
1 Replies

4. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

5. Shell Programming and Scripting

Print unique names in each row of a specific column using awk

Is it possible to remove redundant names in the 4th column? input cqWE 100 200 singapore;singapore AZO 300 400 brazil;america;germany;ireland;germany .... .... output cqWE 100 200 singapore AZO 300 400 brazil;america;germany;ireland (4 Replies)
Discussion started by: quincyjones
4 Replies

6. Shell Programming and Scripting

Print unique names in a specific column using awk

Is it possible to modify file like this. 1. Remove all the duplicate names in a define column i.e 4th col 2. Count the no.of unique names separated by ";" and print as a 5th col thanx in advance!! Q input c1 30 3 Eh2 c10 96 3 Frp c41 396 3 Ua5;Lop;Kol;Kol c62 2 30 Fmp;Fmp;Fmp ... (5 Replies)
Discussion started by: quincyjones
5 Replies

7. Shell Programming and Scripting

Need a word which just comes next to after grep of a specific word

Hi, Below is an example : ST1 PREF: int1 AVAIL: int2 ST2 PREF :int1 AVAIL: int2 I need int1 to come in preferred variable while programming and int2 in available variable Please help me doing so Best regards, Vishal (10 Replies)
Discussion started by: Vishal_dba
10 Replies

8. Shell Programming and Scripting

awk to match keyword and return matches and unique fields

Trying to use awk to find a keyword and return the matches in the row, but also $1 and $2, which are the unique id's, but they only appear once. Thank you :). file name 31 Index Chromosomal Position Gene Inheritance 122 2106725 TSC2 AD 124 2115481 TSC2 AD 121 2105400 TSC2 AD... (6 Replies)
Discussion started by: cmccabe
6 Replies

9. Shell Programming and Scripting

Getting max value of specific fields with awk

Hello All, Here is am trying to get maximum value of third field depending on first,second and fourth fields with awk command . delimeter is pipe(|) . input 0221|09|14.25|aaa 0221|09|44.27|aaa 0221|09|44.33|aaa 0221|09|44.53|bbb 0221|09|34.32|bbb 0221|09|37.13|bbb... (5 Replies)
Discussion started by: sayami00
5 Replies
adapt(4rheolef) 						    rheolef-6.1 						   adapt(4rheolef)

NAME
adapt - mesh adaptation SYNOPSYS
geo adapt (const field& phi); geo adapt (const field& phi, const adapt_option_type& opts); DESCRIPTION
The function adapt implements the mesh adaptation procedure, based on the gmsh (isotropic) or bamg (anisotropic) mesh generators. The bamg mesh generator is the default in two dimension. For dimension one or three, gmsh is the only generator supported yet. In the two dimensional case, the gmsh correspond to the opts.generator="gmsh". The strategy based on a metric determined from the Hessian of a scalar governing field, denoted as phi, and that is supplied by the user. Let us denote by H=Hessian(phi) the Hessian tensor of the field phi. Then, |H| denote the tensor that has the same eigenvector as H, but with absolute value of its eigenvalues: |H| = Q*diag(|lambda_i|)*Qt The metric M is determined from |H|. Recall that an isotropic metric is such that M(x)=hloc(x)^(-2)*Id where hloc(x) is the element size field and Id is the identity d*d matrix, and d=1,2,3 is the physical space dimension. GMSH ISOTROPIC METRIC
max_(i=0..d-1)(|lambda_i(x)|)*Id M(x) = ----------------------------------------- err*hcoef^2*(sup_y(phi(y))-inf_y(phi(y))) Notice that the denominator involves a global (absolute) normalization sup_y(phi(y))-inf_y(phi(y)) of the governing field phi and the two parameters opts.err, the target error, and opts.hcoef, a secondary normalization parameter (defaults to 1). BAMG ANISOTROPIC METRIC
There are two approach for the normalization of the metric. The first one involves a global (absolute) normalization: |H(x))| M(x) = ----------------------------------------- err*hcoef^2*(sup_y(phi(y))-inf_y(phi(y))) The first one involves a local (relative) normalization: |H(x))| M(x) = ----------------------------------------- err*hcoef^2*(|phi(x)|, cutoff*max_y|phi(y)|) Notice that the denominator involves a local value phi(x). The parameter is provided by the optional variable opts.cutoff; its default value is 1e-7. The default strategy is the local normalization. The global normalization can be enforced by setting opts.additional="-AbsError". When choosing global or local normalization ? When the governing field phi is bounded, i.e. when err*hcoef^2*(sup_y(phi(y))-inf_y(phi(y))) will converge versus mesh refinement to a bounded value, the global normalization defines a metric that is mesh-independent and thus the adaptation loop will converge. Otherwise, when phi presents singularities, with unbounded values (such as corner singularity, i.e. presents peacks when represented in elevation view), then the mesh adaptation procedure is more difficult. The global normalization divides by quantities that can be very large and the mesh adaptation can diverges when focusing on the singularities. In that case, the local normalization is preferable. Moreover, the focus on singularities can also be controled by setting opts.hmin not too small. The local normalization has been choosen as the default since it is more robust. When your field phi does not present singularities, then you can swith to the global numbering that leads to a best equirepartition of the error over the domain. IMPLEMENTATION
struct adapt_option_type { typedef std::vector<int>::size_type size_type; std::string generator; bool isotropic; Float err; Float errg; Float hcoef; Float hmin; Float hmax; Float ratio; Float cutoff; size_type n_vertices_max; size_type n_smooth_metric; bool splitpbedge; Float thetaquad; Float anisomax; bool clean; std::string additional; bool double_precision; Float anglecorner; // angle below which bamg considers 2 consecutive edge to be part of // the same spline adapt_option_type() : generator(""), isotropic(true), err(1e-2), errg(1e-1), hcoef(1), hmin(0.0001), hmax(0.3), ratio(0), cutoff(1e-7), n_vertices_max(50000), n_smooth_metric(1), splitpbedge(false), thetaquad(std::numeric_limits<Float>::max()), anisomax(1e6), clean(false), additional("-RelError"), double_precision(false), anglecorner(0) {} }; template <class T, class M> geo_basic<T,M> adapt ( const field_basic<T,M>& phi, const adapt_option_type& options = adapt_option_type()); rheolef-6.1 rheolef-6.1 adapt(4rheolef)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy