The above is what I am trying to do as each element is treated as a pair, so it. That is each $2 is combined with a $3. Basically, the opposite of my code. I can seem to print the lines in the range, but not the lines not in the range. Thank you .
You have confused the matter more. You are not looking at $3 in file2 so it can't possibly affect the output produced by your script. If you just want to reverse the output produced by your script change it to:
or, using the default action when a condition is met:
or to take less space:
This User Gave Thanks to Don Cragun For This Post:
Hi,
I need to retrieve the lines which fall under the given date range.
eg:In a log file,i have the lines which will have the timestamp.
the input will be some date range.eg: from date:03/Jan/2008,to date:24/Jul/2008.so now i want to retrieve the lines
which have the timestamp between these... (5 Replies)
Hi,
I have two comma separated files. I would like to see field 1 value of File1 exact match in field 2 of File2. If the value matches, then it should print matched lines from File2. I have achieved the results using cut, paste and egrep -f but I would like to use awk as it is efficient way and... (7 Replies)
Hi
file.in and file.out are in csv format. the code I have now is,
cat file.in | awk -F"," '!($1$2$3$4$5$6$7$8 in a){a;print $0}' > file.out
Here, I am printing entire line using $0. however, I want to print $1 to $150 and it should be in csv format. Cut -d is not good in performace.... (3 Replies)
Hi all,
on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern.
the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/'
I need to include the... (1 Reply)
Hi,
I have a file as below
This is the line one
This is the line two
<\XMLTAG>
This is the line three
This is the line four
<\XMLTAG>
Output of the SED command need to be as below.
This is the line one
This is the line two
<\XMLTAG>
Please do the need to needful to... (4 Replies)
Hi Guru's,
I am trying to grep a range of line numbers (based on match) and then look for another match which starts with a special character '$' and print the line number. I have the below code but it is actually printing the line number counting starting from the first line of the range i am... (15 Replies)
Hi,
I have attached an output file which is some kind of database file mapping. It is basically like an allocation mapping of a tablespace and its datafile/s.
The output is generated by the SQL script that I found from 401 Authorization Required
Excerpts of the file are as below:
... (2 Replies)
Hi I am having a code as stated below
module abcd( a , b , c ,da , fa, na , ta , ma , ra ,
ta, la , pa );
input a , b, da ,fa , na , ta , ma;
output c , ra ,ta ,
la ,pa ;
wire a , b , da , fa ,na ,
ta , ma;
endmodule
I need to match the string... (1 Reply)
Discussion started by: kshitij
1 Replies
LEARN ABOUT OSF1
diff3
diff3(1) General Commands Manual diff3(1)NAME
diff3 - Compares three files
SYNOPSIS
diff3 [-e | -x | -E | -X | -3] file1 file2 file3
The diff3 command reads three versions of a file and writes to standard output the ranges of text that differ.
OPTIONS
Creates an edit script for use with the ed command to incorporate into file1 all changes between file2 and file3 (that is, the changes that
normally would be flagged ==== and ====3). Produces an edit script to incorporate only changes flagged ====. These are similar to -e and
-x, respectively, but treat overlapping changes (that is, changes that are flagged ==== in the normal listing) differently. The overlap-
ping lines from both files are inserted by the edit script, bracketed by <<<<<< and >>>>>> lines. The -E option is used by RCS merge to
ensure that overlapping changes in the merged files are preserved and brought to someone's attention. Produces an edit script to incorpo-
rate only changes flagged ====3.
DESCRIPTION
The diff3 command reads three versions of a file and writes to standard output the ranges of text that differ, flagged with the following
codes: All three files differ. file1 differs. file2 differs. file3 differs.
The type of change needed to convert a given range of a given file to match another file is indicated in one of these two ways in the out-
put: Text is to be added after line number number1 in file, where file is 1, 2, or 3. Text in the range line number1 to line number2 is to
be changed. If number1 = number2, the range may be abbreviated to number1.
The original contents of the range follow immediately after a c indication. When the contents of two files are identical, diff3 does not
show the contents of the lower-numbered file, although it shows the location of the identical lines for each.
NOTES
Editing scripts produced by the -e option cannot create lines consisting only of a single . (dot).
EXAMPLES
To list the differences among three files, enter: diff3 fruit.a fruit.b fruit.c
fruit.a, fruit.b, and fruit.c contain the following data:
fruit.a:
banana grape kiwi lemon mango orange peach pare
fruit.b:
apple banana grapefruit kiwi orange peach pear
fruit.c:
grape grapefruit kiwi lemon mango orange peach pear
The output from diff3 shows the differences between these files as follows. (The comments on the right do not appear in the output.)
==== All three files are different. 1:1,2c - Lines 1 and 2 of the first file, fruit.a
banana
grape 2:1,3c - Lines 1 through 3 of fruit.b
apple
banana
grapefruit 3:1,2c - Lines 1 and 2 of fruit.c
grape
grapefruit ====2 The second file, fruit.b, is different. 1:4,5c - Lines 4 and 5 are the same in fruit.a and fruit.c. 2:4a
3:4,5c - To make fruit.b look the same, add text after line 4.
lemon
mango ====1 The first file, fruit.a, is different. 1:8c
pare 2:7c - Line 7 of fruit.b and line 8 of fruit.c are the same. 3:8c
pear
FILES
Helper program.
SEE ALSO
Commands: bdiff(1), cmp(1), comm(1), diff(1), ed(1)diff3(1)