03-24-2017
Quote:
Originally Posted by
Corona688
In what context would awk use collation, though? > < for strings, or does it have other meaning?
In standard
awk, just for
< and
> on string operands. I believe
gawk and some other versions of
awk have extensions to the standards that provide built-in functions to sort arrays (which presumably would sort in collation order).
These 2 Users Gave Thanks to Don Cragun For This Post:
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 CENTOS
create_collation
CREATE
COLLATION(7) PostgreSQL 9.2.7 Documentation CREATE COLLATION(7)
NAME
CREATE_COLLATION - define a new collation
SYNOPSIS
CREATE COLLATION name (
[ LOCALE = locale, ]
[ LC_COLLATE = lc_collate, ]
[ LC_CTYPE = lc_ctype ]
)
CREATE COLLATION name FROM existing_collation
DESCRIPTION
CREATE COLLATION defines a new collation using the specified operating system locale settings, or by copying an existing collation.
To be able to create a collation, you must have CREATE privilege on the destination schema.
PARAMETERS
name
The name of the collation. The collation name can be schema-qualified. If it is not, the collation is defined in the current schema.
The collation name must be unique within that schema. (The system catalogs can contain collations with the same name for other
encodings, but these are ignored if the database encoding does not match.)
locale
This is a shortcut for setting LC_COLLATE and LC_CTYPE at once. If you specify this, you cannot specify either of those parameters.
lc_collate
Use the specified operating system locale for the LC_COLLATE locale category. The locale must be applicable to the current database
encoding. (See CREATE DATABASE (CREATE_DATABASE(7)) for the precise rules.)
lc_ctype
Use the specified operating system locale for the LC_CTYPE locale category. The locale must be applicable to the current database
encoding. (See CREATE DATABASE (CREATE_DATABASE(7)) for the precise rules.)
existing_collation
The name of an existing collation to copy. The new collation will have the same properties as the existing one, but it will be an
independent object.
NOTES
Use DROP COLLATION to remove user-defined collations.
See Section 22.2, "Collation Support", in the documentation for more information about collation support in PostgreSQL.
EXAMPLES
To create a collation from the operating system locale fr_FR.utf8 (assuming the current database encoding is UTF8):
CREATE COLLATION french (LOCALE = 'fr_FR.utf8');
To create a collation from an existing collation:
CREATE COLLATION german FROM "de_DE";
This can be convenient to be able to use operating-system-independent collation names in applications.
COMPATIBILITY
There is a CREATE COLLATION statement in the SQL standard, but it is limited to copying an existing collation. The syntax to create a new
collation is a PostgreSQL extension.
SEE ALSO
ALTER COLLATION (ALTER_COLLATION(7)), DROP COLLATION (DROP_COLLATION(7))
PostgreSQL 9.2.7 2014-02-17 CREATE COLLATION(7)