10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
3679 Jul 21 23:59 belk_rpo_error_**po9324892**_07212014.log
0 Jul 22 23:59 belk_rpo_error_**po9324892**_07222014.log
3679 Jul 23 23:59 belk_rpo_error_**po9324892**_07232014.log
22 Jul 22 06:30 belk_rpo_error_**po9324267**_07012014.log
0 Jul 20 05:50... (5 Replies)
Discussion started by: LoneRanger
5 Replies
2. Shell Programming and Scripting
Hi,
I want to compare two columns from file1 with another two column of file2 and print matched and unmatched column like this
File1
1 rs1 abc
3 rs4 xyz
1 rs3 stu
File2
1 kkk rs1 AA 10
1 aaa rs2 DD 20
1 ccc ... (2 Replies)
Discussion started by: justinjj
2 Replies
3. Shell Programming and Scripting
I have a file some thing like this:
GN Name=YWHAB;
RC TISSUE=Keratinocyte;
RC TISSUE=Thymus;
CC -!- FUNCTION: Adapter protein implicated in the regulation of a large
CC spectrum of both general and specialized signaling pathways
GN Name=YWHAE;
RC TISSUE=Liver;
RC ... (13 Replies)
Discussion started by: raj_k
13 Replies
4. Shell Programming and Scripting
Hi I have a matrix with n rows and m columns like below example. i want to extract all the pairs with values <200.
Input
A B C D
A 100 206 51 300
B 206 100 72 48
C 351 22 100 198
D 13 989 150 100
Output format
A,A:200
A,C:51
B,B:100... (2 Replies)
Discussion started by: anurupa777
2 Replies
5. Shell Programming and Scripting
I have a file named file.txt that looks as follows
//class1.txt
45
234
67
89
90
//class2.txt
456
34
78
89
120
class1 and class2.txt are the names of files in a folder named folder1.
The content of class1.txt file in folder1
67 9
89 5
234 9The content of class2.txt file in... (1 Reply)
Discussion started by: jaff rufus
1 Replies
6. Shell Programming and Scripting
hi
my problem is little complicated one. i have 2 files which appear like this
file 1
abbsss:aa:22:34:as akl abc 1234
mkilll:as:ss:23:qs asc abc 0987
mlopii:cd:wq:24:as asd abc 7866
file2
lkoaa:as:24:32:sa alk abc 3245
lkmo:as:34:43:qs qsa abc 0987
kloia:ds:45:56:sa acq abc 7805
i... (5 Replies)
Discussion started by: anurupa777
5 Replies
7. Shell Programming and Scripting
I have 2 files whose data's are as follows :
fileA
00 lieferungen
00 attractiop
01 done
02 forness
03 rasp
04 alwaysisng
04 funny
05 done1
fileB
alwayssng
dkhf
fdgdfg
dfgdg
sdjkgkdfjg
funny
rasp (7 Replies)
Discussion started by: rajniman
7 Replies
8. Shell Programming and Scripting
Hi Experts,
Is there a way to compare 2 files by columns and print matching cases.
I have 2 files as below, I want cases where col1 and col2 in f1 matches col1 and col2 in f2 to be printed as output. The separator is space. I want the output to have col1 col2 col 3 from both files printed... (7 Replies)
Discussion started by: novice_man
7 Replies
9. Shell Programming and Scripting
Hiiiii friends
I have 2 files which contains huge data & few lines of it are as shown below
File1: b.dat(which has 21 columns)
SSR 1976 8 12 13 10 44.00 39.0700 70.7800 7.0 0 0.00 0 2.78 0.00 0.00 0 0.00 2.78 0 NULL
ISC 1976 8 12 22 32 37.39 36.2942 70.7338... (6 Replies)
Discussion started by: reva
6 Replies
10. Shell Programming and Scripting
Hi,
I have two tab separated files;
file1:
S.No ddi fi cu o/l t+ t-
1 0.5 0.6 o 0.1 0.2
2 0.2 0.3 l 0.3 0.4
3 0.5 0.8 l 0.1 0.6
... (5 Replies)
Discussion started by: vasanth.vadalur
5 Replies
SORT(1) General Commands Manual SORT(1)
NAME
sort - sort and/or merge files
SYNOPSIS
sort [ -cmuMbdfinrwtx ] [ +pos1 [ -pos2 ] ... ] ... [ -k pos1 [ ,pos2 ] ] ...
' [ -o output ] [ -T dir ... ] [ option ... ] [ file ... ]
DESCRIPTION
Sort sorts lines of all the files together and writes the result on the standard output. If no input files are named, the standard input
is sorted.
The default sort key is an entire line. Default ordering is lexicographic by runes. The ordering is affected globally by the following
options, one or more of which may appear.
-M Compare as months. The first three non-white space characters of the field are folded to upper case and compared so that precedes
etc. Invalid fields compare low to
-b Ignore leading white space (spaces and tabs) in field comparisons.
-d `Phone directory' order: only letters, accented letters, digits and white space are significant in comparisons.
-f Fold lower case letters onto upper case. Accented characters are folded to their non-accented upper case form.
-i Ignore characters outside the ASCII range 040-0176 in non-numeric comparisons.
-w Like -i, but ignore only tabs and spaces.
-n An initial numeric string, consisting of optional white space, optional plus or minus sign, and zero or more digits with optional
decimal point, is sorted by arithmetic value.
-g Numbers, like -n but with optional e-style exponents, are sorted by value.
-r Reverse the sense of comparisons.
-tx `Tab character' separating fields is x.
The notation +pos1 -pos2 restricts a sort key to a field beginning at pos1 and ending just before pos2. Pos1 and pos2 each have the form
m.n, optionally followed by one or more of the flags Mbdfginr, where m tells a number of fields to skip from the beginning of the line and
n tells a number of characters to skip further. If any flags are present they override all the global ordering options for this key. A
missing .n means .0; a missing -pos2 means the end of the line. Under the -tx option, fields are strings separated by x; otherwise fields
are non-empty strings separated by white space. White space before a field is part of the field, except under option -b. A b flag may be
attached independently to pos1 and pos2.
The notation -k pos1[,pos2] is how POSIX sort defines fields: pos1 and pos2 have the same format but different meanings. The value of m is
origin 1 instead of origin 0 and a missing .n in pos2 is the end of the field.
When there are multiple sort keys, later keys are compared only after all earlier keys compare equal. Lines that otherwise compare equal
are ordered with all bytes significant.
These option arguments are also understood:
-c Check that the single input file is sorted according to the ordering rules; give no output unless the file is out of sort.
-m Merge; assume the input files are already sorted.
-u Suppress all but one in each set of equal lines. Ignored bytes and bytes outside keys do not participate in this comparison.
-o The next argument is the name of an output file to use instead of the standard output. This file may be the same as one of the
inputs.
-Tdir Put temporary files in dir rather than in /var/tmp.
EXAMPLES
Print in alphabetical order all the unique spellings
in a list of words where capitalized words differ from uncapitalized.
Print the users file
sorted by user name (the second colon-separated field).
Print the first instance of each month in an already sorted file.
Options -um with just one input file make the choice of a unique representative from a set of equal lines predictable.
grep -n '^' input | sort -t: +1f +0n | sed 's/[0-9]*://'
A stable sort: input lines that compare equal will come out in their original order.
FILES
/var/tmp/sort.<pid>.<ordinal>
SOURCE
/src/cmd/sort.c
SEE ALSO
uniq(1), look(1)
DIAGNOSTICS
Sort comments and exits with non-null status for various trouble conditions and for disorder discovered under option -c.
BUGS
An external null character can be confused with an internally generated end-of-field character. The result can make a sub-field not sort
less than a longer field.
Some of the options, e.g. -i and -M, are hopelessly provincial.
SORT(1)