Hello,
I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3.
For example:
file 1
123
1234
123456
file 2
123
2345
23456
file 3 should have
2345
23456
I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
I have made several attempts to read two files of ip addresses and eliminate records from file1 that are in file2.
My latest attempt follows. Everything works except my file3 is exactly the same as file1 and it should not be.
# !/usr/bin/bash
#
# NoInterfaces
# Utility will create a file... (8 Replies)
What I really need is a script that compares 2 (.csv) text files line by line with a single entries on each line and then outputs NON-duplicate lines to a third (.csv) text file, the problem is the lines may be exactly the same, but in different order in the 2 text files, so
sourcefile1... (11 Replies)
Hi,
i have 2 input files which are file1.txt and file2.txt. I need to extract data from file1.txt and file2.txt and save it in file3.txt like example below:-
File1.txt
ID scrap1
Name scrap1
start 1
end 10
ID scrap2
Name scrap2
start 11
end ... (4 Replies)
Can any one please help, the code works...I want the output of $result to be saved in an output.txt file which is lcoated in c:\\temp\\output.txt.
$filepath="C:\\temp\\ip.txt";
open (HOSTLIST,"$filepath");
@hosts=(<HOSTLIST>);
foreach $host(@hosts)
{
$results = `nslookup... (1 Reply)
Hi,
I am new to shell scripting.
please help me to find out the solution.
I need a script where we need to read the text file(consists of all file names) and get the file names one by one
and append the date suffix for each file name as 'yyyymmdd' .
Then search each file if exists... (1 Reply)
Assitance needed in checking file difference using a perl script
Below is the example
I wanted a report saying file2 has an update of new value.
File1 old date
Alpha 156
Beta 255
Gama 6987
segma 4578
File2 new date
Alpha 156
Beta 255
Gama 1000 (3 Replies)
Hi there.
i have created a program that in the end it will give output like this
1 2 3 4 5
10 9 8 7 6
11 12 13 14 15
.............. 17
i wonder how to save the output into a single string and into a file.
i.e 1 10 11 12 9 2 3 8 13 14 7 4 5 6 15 17 (in this order,... (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Hi there.
i have created a program that in the end it will give output like this
1 2 3 4 5
10 9 ... (1 Reply)
Discussion started by: shdin271
1 Replies
LEARN ABOUT LINUX
algorithm::diff::xs
Algorithm::Diff::XS(3pm) User Contributed Perl Documentation Algorithm::Diff::XS(3pm)NAME
Algorithm::Diff::XS - Algorithm::Diff with XS core loop
SYNOPSIS
# Drop-in replacement to Algorithm::Diff, but "compact_diff"
# and C<LCSidx> will run much faster for large data sets.
use Algorithm::Diff::XS qw( compact_diff LCSidx );
DESCRIPTION
This module is a simple re-packaging of Joe Schaefer's excellent but not very well-known Algorithm::LCS with a drop-in interface that
simply re-uses the installed version of the Algorithm::Diff module.
Note that only the "LCSidx" function is optimized in XS at the moment, which means only "compact_diff" will get significantly faster for
large data sets, while "diff" and "sdiff" will run in identical speed as "Algorithm::Diff".
BENCHMARK
Rate Algorithm::Diff Algorithm::Diff::XS
Algorithm::Diff 14.7/s -- -98%
Algorithm::Diff::XS 806/s 5402% --
The benchmarking script is as below:
my @data = ([qw/a b d/ x 50], [qw/b a d c/ x 50]);
cmpthese( 500, {
'Algorithm::Diff' => sub {
Algorithm::Diff::compact_diff(@data)
},
'Algorithm::Diff::XS' => sub {
Algorithm::Diff::XS::compact_diff(@data)
},
});
SEE ALSO
Algorithm::Diff, Algorithm::LCS.
AUTHORS
Audrey Tang <cpan@audreyt.org>
COPYRIGHT
Copyright 2008 by Audrey Tang <cpan@audreyt.org>.
Contains derived code copyrighted 2003 by Joe Schaefer, <joe+cpan@sunstarsys.com>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.3 2008-10-24 Algorithm::Diff::XS(3pm)