03-23-2017
Hi Corona,
Thank for your time but i already know how do the associativ array works.
In fact i was refering and wondering about to the "collating" notation mentionned
here
it says
"A collating symbol is a multi-character sequence that should be treated as a unit"
so if
[.my_word.] is more or less processed the same way as
/my_word/ , i don't see the added value of this specific notation so i was wondering what is behind
"treated as a unit" ...
So if someone has a good example of a context in which such notation is necessary, i would be glad to have a look at it, because i think i miss something here.
Last edited by ctsgnb; 03-23-2017 at 01:18 PM..
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
LEARN ABOUT DEBIAN
units-filter
UNITS-FILTER(1) units-filter User Manual UNITS-FILTER(1)
NAME
units-filter - is a parser for physical and chemical quantities
SYNOPSIS
units-filter -s -o -l
DESCRIPTION
units-filter is a basic standalone parser written in C language, flex and bison. It inputs strings like "1.5e3 nN.m.s^-1" (it could be the
time growth ratio of a torque) and outputs the value in standard SI unit, followed by the physical dimension of this value.
OPTIONS
-s
Like Significant.
Takes in account the number of significant digits. For example 1.0 m contains 2 significant digits, while 0.00100 contains 3
significant digits. It is possible to enforce the number of significant digits by using a special syntax : if units-filter parses the
input "1.0m#6", it interprets it as a value with exactly 6 significant digits, like "1.00000 m". The number following the # sign is the
forced number of significant digits. The number of significant digits appears just before the last zero in the output of the command
(this zero is a placeholder for future extensions).
-o
Like Output.
Outputs a correct representation of the physical quantity with its physical unit in the International System notation. There may be
some simplification with usual units. For example, a newton will be represented by the unit N in place of m.kg.s^-2. The value is
expressed as a floating number with one digit before the decimal point, and as many digits in the mantissa as necessary to fit the
desired number of significant digits (see an example below). It is possible to enforce the output unit : just add a colon and the
desired unit at the end of the input. If this unit is homogeneous with the former one, it will be used to format the output.
-l
Like LaTeX.
Outputs a correct representation of the physical quantity with its physical unit in the International System notation, in LaTeX
language.
EXAMPLES
Establish the SI value and unit exponent of a quantity in the mksa system:
~$ echo 1.5e3 nN.m.s^-1 | units-filter
1.5e-6 2 1 -3 0 0 0 0
which means : 1.5e-6 (SI unit) m^2.kg.s^-3
Compare different physical quantities:
~$ e1=$(echo "1.2e-3 V" | units-filter)
~$ e2=$(echo "1200e3 nWb/s"| units-filter)
~$ if [ "$e1" = "$e2" ]; then echo ok; else echo ko; fi
ok
... which emphasizes that webers by unit time are the same as volts.
Playing with the number of significant digits:
~$ echo "0.00100m" | src/units-filter -s
0.001 1 0 0 0 0 0 0 3 0
~$ echo "0.00100m #2" | src/units-filter -s
0.001 1 0 0 0 0 0 0 2 0
Giving a value for the relative precision:
~$ echo "1kV~2" | units-filter -o
1e+03 V +-2%
Turning on the LaTeX output:
~$ echo "1kohm+-2%" | units-filter -l
1 imes 10^{+03}, Omega pm 2,\%
Turning on the output of a canonical physical notation:
~$ echo "1.0 m.kg.s^-2 #7" | units-filter -o
1.000000e+00N
Choosing a non-standard unit for the output:
~$ echo 1800C:A.h| units-filter -o
5.000e-01 A.h
KNOWN BUGS
Few units out of the mksa system are successfully parsed.
AUTHOR
Georges Khaznadar <georgesk@ofset.org>
Wrote this manpage.
COPYRIGHT
Copyright (C) 2009 Georges Khaznadar
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at
your option) any later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
units-filter 11/19/2011 UNITS-FILTER(1)