03-23-2017
Context for use of [.symbol.] awk notation
Hi
Just wondering ... do you have an example of context that would demonstrates how usefull the awk notation
[.symbol.] can efficiently be used ?
Thx
![Roll Eyes (Sarcastic) Smilie](https://www.unix.com/images/smilies/rolleyes.gif)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
here is a data file.
-------------------------------------
KSH, CSH, BASH, PERL, PHP, SED, AWK
KSH, CSH, BASH, PERL, PHP,
BASH, PERL, PHP, SED, AWK
CSH, BASH, PERL, PHP, SED,
KSH, CSH, BASH, PERL, PHP, SED, AWK
-------------------------------------
My desired output is... (2 Replies)
Discussion started by: VTAWKVT
2 Replies
2. Shell Programming and Scripting
Hi ,
I have a bunch of files with different # of columns but I want to write a single awk script.
What is the awk symbol for last column? say '{print $lastcol}' or something (3 Replies)
Discussion started by: grossgermany
3 Replies
3. Shell Programming and Scripting
I have various numbers that I'm printing out from a statistical summary script. I'd like it to stop using exponential format. Of course, I can use printf with 'd' and 'f' and various parameters to specify a format, but then it has other undesirable effects, like tacking on extra 0's or truncating... (0 Replies)
Discussion started by: treesloth
0 Replies
4. Solaris
deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies
5. Shell Programming and Scripting
wondering if anyone has any thoughts to convert the below thru a shell script
Convert decimal signalling point notation to ANSI point code notation
There is a site that does that conversion but i need to implement the solution in a shell script.....Thoughts....
OS: Solaris 9
... (4 Replies)
Discussion started by: aavam
4 Replies
6. Shell Programming and Scripting
echo 0.633588 1875 | awk '{print $1 * $2 * 1024}'
is there a better way to run the above command? it keeps printing out in notation and i do not want that at all.
when i run the above, i get:
1.21649e+06
OS: linux
language:bash (1 Reply)
Discussion started by: SkySmart
1 Replies
7. Shell Programming and Scripting
hello folks,
I have few values in a log which are in scientific notation.
I am trying to convert into actual decimal format or integer but couldn't able to convert.
Values in scientific notation:
1.1662986666666665E-4
2.0946799999999998E-4
3.0741333333333333E-6
5.599999999999999E-7... (2 Replies)
Discussion started by: scriptscript
2 Replies
8. Shell Programming and Scripting
can someone spot what i'm doing wrong here:
awk 'BEGIN{printf("%0.2f", 1 / 2649320) * 100}'
i get this error:
awk: line 1: syntax error at or near *
then i do this and get the answer i'm trying to avoid:
awk 'BEGIN{print(1 / 2649320) * 100}'
3.77455e-05 (7 Replies)
Discussion started by: SkySmart
7 Replies
9. Shell Programming and Scripting
Input file:
data1 0.05
data2 1e-14
data1 1e-330
data2 1e-14
data5 2e-60
data5 2e-150
data1 4e-9
Desired output:
data2 1e-14
data1 1e-330
data2 1e-14
data5 2e-60
data5 2e-150
I would like to filter out those result that column 2 is less than 1e-10.
Command try: (1 Reply)
Discussion started by: cpp_beginner
1 Replies
10. Shell Programming and Scripting
I wrote this code, questions follow
#! /bin/bash -f
# Purpose - to show how if syntax is used within an awk
clear;
ls -l;
echo "This will print out the first two columns of the inputted file in this directory";
echo "Enter filename found in this directory";
read input;
... (11 Replies)
Discussion started by: Seth
11 Replies
mass(3rheolef) rheolef-6.1 mass(3rheolef)
NAME
mass -- L2 scalar product
SYNOPSIS
form(const space& V, const space& V, "mass");
form(const space& M, const space& V, "mass");
form (const space& V, const space& V, "mass", const domain& gamma);
form_diag(const space& V, "mass");
DESCRIPTION
Assembly the matrix associated to the L2 scalar product of the finite element space V.
/
|
m(u,v) = | u v dx
|
/ Omega
The V space may be either a P0, P1, P2, bubble, P1d and P1d finite element spaces for building a form see form(2).
The use of quadrature formulae is sometime usefull for building diagonal matrix. These approximate matrix are eay to invert. This proce-
dure is available for P0 and P1 approximations.
Notes that when dealing with discontinuous finite element space, i.e. P0 and P1d, the corresponding mass matrix is block diagonal, and the
inv_mass form may be usefull.
When two different space M and V are supplied, assembly the matrix associated to the projection operator from one finite element space M to
space V.
/
|
m(q,v) = | q v dx
|
/ Omega
for all q in M and v in V.
This form is usefull for instance to convert discontinuous gradient components to a continuous approximation. The transpose operator may
also be usefull to performs the opposite operation.
The following $V$ and $M$ space approximation combinations are supported for the mass form: P0-P1, P0-P1d, P1d-P2, P1-P1d and P1-P2.
EXAMPLE
The following piece of code build the mass matrix associated to the P1 approximation:
geo g("square");
space V(g, "P1");
form m(V, V, "mass");
The use of lumped mass form write also:
form_diag md(V, "mass");
The following piece of code build the projection form:
geo g("square");
space V(g, "P1");
space M(g, "P0");
form m(M, V, "mass");
SCALAR PRODUCT ON THE BOUNDARY
Assembly the matrix associated to the L2 scalar product related to a boundary domain of a mesh and a specified polynomial approximation.
These forms are usefull when defining non-homogeneous Neumann or Robin boundary conditions.
Let W be a space of functions defined on Gamma, a subset of the boundary of the whole domain Omega.
/
|
m(u,v) = | u v dx
|
/ Gamma
for all u, v in W. Let V a space of functions defined on Omega and gamma the trace operator from V into W. For all u in W and v in V:
/
|
mb(u,v) = | u gamma(v) dx
|
/ Gamma
For all u and v in V:
/
|
ab(u,v) = | gamma(u) gamma(v) dx
|
/ Gamma
EXAMPLE
The following piece of code build forms for the P1 approximation, assuming that the mesh contains a domain named boundary:
geo omega ("square");
domain gamma = omega.boundary();
space V (omega, "P1");
space W (omega, gamma, "P1");
form m (W, W, "mass");
form mb (W, V, "mass");
form ab (V, V, "mass", gamma);
SEE ALSO
form(2)
rheolef-6.1 rheolef-6.1 mass(3rheolef)