suppose i have one file
file A
18
24
30
35
38
45
55
Another file file B
08_46 A 16 V -0.36 0.23 E : 1.41
08_46 A 17 D -1.04 0.22 E : 0.84
08_46 A 18 Q -0.49 0.12 E : 0.06
08_46 A 19 G 0.50 0.14 E : 0.05
08_46 A 20 V ... (5 Replies)
AWK subtraction in multiple columns
Hi there,
Can not get the following:
input: 34523 934
9485 3847
394 3847
3456 9384
awk 'NR==1 {for (i = 1; i <= NF; i++) {n=$i; next}; {n-=$i} END {print n}' input
output: 21188 first column only,... (2 Replies)
Hi,
I am trying to debug an old script and have found the problem lies within this function:
isIdoc() { # validate the file type
fileType=`file $1 | awk '{print $NF}'`
&& echo 0 || echo 1
}
My question is, how can I determine what is in the variable $fileType ? The program is... (1 Reply)
Hi All,
I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file.
Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Hi,
OS = Solaris
Can anyone advise if there is a one liner to print specific output from a df -k output?
Running df from a command line, it sometimes gives me 2 lines for some volume. By re-directing the output to a file, it always gives 1 line for each.
Below is an example output,... (4 Replies)
Hello friends,
I have written a script and i need to add some part into it so that i could print out more results depending on more conditions,
This is the core part of the script which does the actual work:
echo "$j" && nawk -v stat=$2 'NR==FNR &&... (1 Reply)
When I output fields 1 2 4 5 & 6, I would like to have a comma between them but I am beating my head against the wall to get it to work. Any help is appreciated
sed 's/]*,]*/,/g' file1 > file1.$$ && awk -F, 'FNR==NR{f2=$1 $2 $4 $5 $6;next} FNR==1{print $0, "CDP NE Hostname,CDP NE IP,Remote... (6 Replies)
Discussion started by: dis0wned
6 Replies
LEARN ABOUT OSF1
merge
merge(1)merge(1)NAME
merge - three-way file merge
SYNOPSIS
merge [-Llabel1 [-Llabel3]] [-p] [-q] file1 file2 file3
DESCRIPTION
merge incorporates all changes that lead from file2 to file3 into file1. The result goes to standard output if -p is present, into file1
otherwise. merge is useful for combining separate changes to an original. Suppose file2 is the original, and both file1 and file3 are
modifications of file2. Then merge combines both changes.
An overlap occurs if both file1 and file3 have changes in a common segment of lines. On a few older hosts where diff3 does not support the
-E option, merge does not detect overlaps, and merely supplies the changed lines from file3. On most hosts, if overlaps occur, merge out-
puts a message (unless the -q option is given), and includes both alternatives in the result. The alternatives are delimited as follows:
<<<<<<< file1 lines in file1 ======= lines in file3 >>>>>>> file3
If there are overlaps, the user should edit the result and delete one of the alternatives. If the -L label1 and -L label3 options are
given, the labels are output in place of the names file1 and file3 in overlap reports.
DIAGNOSTICS
Exit status is 0 for no overlaps, 1 for some overlaps, 2 for trouble.
IDENTIFICATION
Author: Walter F. Tichy.
Revision Number: 1.1.6.2; Release Date: 1993/10/07.
Copyright (C) 1982, 1988, 1989 by Walter F. Tichy.
Copyright (C) 1990, 1991 by Paul Eggert.
SEE ALSO diff3(1), diff(1), rcsmerge(1), co(1)merge(1)