My solution stores every description of file1 in memory so if you have a really big file1 or file2 a line-by-line solution would fit best. Anyway, hope it helps.
PS: if an entry in file2 is not found in file1 I just keep file2's description "wrong description".
Hello guys..
I have the following question.
lets have that i have the following variable:
$field=werfiurd383nd93bc93 c93 d93 d9e3 ddd
or
array=werfiurd383nd93bc93 c93 d93 d9e3 ddd
what i would like to do is to store the first 4 characters of gthe aboce variable in variable... (1 Reply)
Hi,
Please advise me how to perform checking in perl on the following input below.
The output criteria will be
1. field 1 will begin as 913354744 for each as example
2. field 4 must be unique.
3. field 7 is showing dd/mm/yyyy, but it require checking if unixtime should covert to... (5 Replies)
hi all,
i am trying to append the output of a find command (for different paths)in an array as below...
my $res_array;
$i=0;
$dir="/orn/ops/regs";
foreach $block("am","xb"){
$bdir="$dir/$block";
$res_array=`find $bdir ! -user mainuser -printf \"\%u \%h\\n\"`;
$i++;
}
i... (6 Replies)
Hello All,
I have been working on a great script to remotely gather server info and store it in a .txt that can be imported to .xls
I have been reading the hostnames that are in the /.shh/known_hosts file so I don't have to mess with passing a password - via ssh (not easy to do , by the... (1 Reply)
I'm in need of help for a project that I'm working on. I believe Perl would be the best way of handling the string manipulation, however, I've barely used perl, and I'm used to BASH scripting. Another note is, this project is in a Windows environment, so I can use Perl, but I do not have shell... (1 Reply)
Hello,
I have mysql binary file which logs all the database queries and i to insert all queries log in to database. First i coverted binary file to text file. and start playing with it. Text file contains following queries, some samples are,
SET INSERT_ID=1;
INSERT INTO test... (0 Replies)
I don't know if this is a big issue or not, but I'm having difficulties. I apoligize for the upcoming essay :o.
I'm writing a script, similar to a paint program that edits images, but in the form of ANSI block characters. The program so far is working. I managed to save the image into a file,... (14 Replies)
I am a UNIX newbee . I have been doing some reading lately but really need help with an an urgent requirement.After almost two days of googling I end up with 0 luck. Hopefully a guru on here will be able to help me out. Here is my requirement:
I have 20 files in a directory with detail records... (6 Replies)
Hi,
I have a file about 100 lines. Each line is about 2000 characters (each line is fixed length). In middle of each line is following constant value
0000040029892586
Now, I want to go through each line and increment by 1.
So, line 1 will have 586
line 2 will have 587, line 3 will have... (4 Replies)
Discussion started by: jakSun8
4 Replies
LEARN ABOUT BSD
diff3
DIFF3(1) General Commands Manual DIFF3(1)NAME
diff3 - 3-way differential file comparison
SYNOPSIS
diff3 [ -exEX3 ] file1 file2 file3
DESCRIPTION
Diff3 compares three versions of a file, and publishes disagreeing ranges of text flagged with these codes:
==== all three files differ
====1 file1 is different
====2 file2 is different
====3 file3 is different
The type of change suffered in converting a given range of a given file to some other is indicated in one of these ways:
f : n1 a Text is to be appended after line number n1 in file f, where f = 1, 2, or 3.
f : n1 , n2 c Text is to be changed in the range line n1 to line n2. If n1 = n2, the range may be abbreviated to n1.
The original contents of the range follows immediately after a c indication. When the contents of two files are identical, the contents of
the lower-numbered file is suppressed.
Under the -e option, diff3 publishes a script for the editor ed that will incorporate into file1 all changes between file2 and file3, i.e.
the changes that normally would be flagged ==== and ====3. Option -x (-3) produces a script to incorporate only changes flagged ====
(====3). The following command will apply the resulting script to `file1'.
(cat script; echo '1,$p') | ed - file1
The -E and -X are similar to -e and -x, respectively, but treat overlapping changes (i.e., changes that would be flagged with ==== in the
normal listing) differently. The overlapping lines from both files will be inserted by the edit script, bracketed by "<<<<<<" and ">>>>>>"
lines.
For example, suppose lines 7-8 are changed in both file1 and file2. Applying the edit script generated by the command
"diff3 -E file1 file2 file3"
to file1 results in the file:
lines 1-6
of file1
<<<<<<< file1
lines 7-8
of file1
=======
lines 7-8
of file3
>>>>>>> file3
rest of file1
The -E option is used by RCS merge(1) to insure that overlapping changes in the merged files are preserved and brought to someone's atten-
tion.
FILES
/tmp/d3?????
/usr/libexec/diff3
SEE ALSO diff(1)BUGS
Text lines that consist of a single `.' will defeat -e.
7th Edition October 21, 1996 DIFF3(1)