HI ALL,
i have a problem when i do a sort sum with many fields.
Is there a limit for fields?
Do you know a solution?
thanks in advance.
the shell is:
# SORT1
SORT1_rcode=777
if ; then
echo "USE $DARSEQ/OTPU.FTPEPREC RECORD F,1000 " > $DARPARSRT/TPEKL508.SORT1_$$.srt
... (6 Replies)
Hey,
I have a file and it has only one field. I need to calculate the sum of each filed as total.
For e.g my file is
1
2
3
4
5
I need to calculate the total sum as 15.
Please let me know how i can do it? (4 Replies)
Hi unix gurus,
I have a urgent requirement, I need to write a AWK script to compare each fields in 2 files using AWK.
Basically my output should be like this.
file1
row|num1|num2|num3
1|one|two|three
2|one|two|three
file2
row|num1|num2|num3
1|one|two|three
2|one|two|four
... (5 Replies)
Hi,
I have two files formatted as following:
File 1: (user_num_ID , realID) (the NR here is 41671)
1 cust_034_60
2 cust_80_91
3 cust_406_4
..
..
File 2: (realID , clusterNumber) (total NR here is 1000)
cust_034_60 2
cust_406_4 3
..
.. (11 Replies)
Hi all,
I have following scenario to perform sum aggregation on certain columns
Node Allocated_Space Pool_Name CS_Group Utilized Space
-------- ---------------- ---------- --------- --------------
bdw1a_lun01 300 bdw_p0 ... (2 Replies)
Hi there,
I have 2 files in following format
cat file_1
Storage Group Name: aaaa
HBA UID SP Name SPPort
------- ------- ------
0 21
Storage Group Name: bbbb
HBA UID... (2 Replies)
i have multiple files with Batch Header, Record detail & Batch trailer data in the files like :
BH 20150225950050N8262
RD 20140918000000 99999999 unk Deferred Settlement -13950
BT01 -13950
*Above sample data donot have the spaces coorectly defined. I do have multiple batch trailer... (1 Reply)
I use the two awk scripts for comparing file1 and file2.
First awk compare $3 column:
awk -v OFS="\t" 'NR==FNR{a=$4;next}{$2=$2 "\t"(a?a:"-")}1' file1 file2Second awk compare $2 column:
awk -v OFS="\t" 'NR==FNR{a=$4;next}{$2=$2 "\t"(a?a:"-")}1' file1 file2 The only difference
... (12 Replies)
In the awk below I am trying to add a penalty to a score to each matching $1 in file2 based on the sum of $3+$4 (variable TL) from file1. Then the $4 value in file1 is divided by TL and multiplied by 100 (this valvue is variable S). Finally, $2 in file2 - S gives the updated $2 result in file2.... (2 Replies)
Hi, I have two TEST files t.xyz and a.xyz which have three columns each. a.xyz have more rows than t.xyz. I will like to output rows at which $1 and $2 of t.xyz match $1 and $2 of a.xyz. Total number of output rows should be equal to that of t.xyz.
It works fine, but when I apply it to large... (6 Replies)
Discussion started by: geomarine
6 Replies
LEARN ABOUT BSD
join
JOIN(1) General Commands Manual JOIN(1)NAME
join - relational database operator
SYNOPSIS
join [ options ] file1 file2
DESCRIPTION
Join forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. If file1 is `-', the standard
input is used.
File1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in
each line.
There is one line in the output for each pair of lines in file1 and file2 that have identical join fields. The output line normally con-
sists of the common field, then the rest of the line from file1, then the rest of the line from file2.
Fields are normally separated by blank, tab or newline. In this case, multiple separators count as one, and leading separators are dis-
carded.
These options are recognized:
-an In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2.
-e s Replace empty output fields by string s.
-jn m Join on the mth field of file n. If n is missing, use the mth field in each file.
-o list
Each output line comprises the fields specified in list, each element of which has the form n.m, where n is a file number and m is a
field number.
-tc Use character c as a separator (tab character). Every appearance of c in a line is significant.
SEE ALSO sort(1), comm(1), awk(1)BUGS
With default field separation, the collating sequence is that of sort -b; with -t, the sequence is that of a plain sort.
The conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous.
7th Edition April 29, 1985 JOIN(1)