I've got a scripting problem that has been bugging me so thought I'd ask the wise people here! Basically I have two overlapping log files, and I want to get the newest lines from the new log file that aren't in the old log file - but not the old lines in the old log that aren't in the new log.
Say the old log file has this content:
And the new log has this content:
I want my script to output:
Essentially, I want a diff of the two files, but only include the lines that are unique to the second file - is this possible?
edit: It seems that I can do it with "grep -v -x -f file1 file2", but this has O(n^2) complexity so won't work nearly fast enough with files that are reasonably long. Any other ideas?
I have to compare two text files, very few of the lines in these files will have some difference in some column.
The files size is in GB.
Sample lines are as below:
11111122222222333333aaaaaaaaaabbbbbbbbbccccccccdddddd
11111122222222333333aaaaaaaaaabbbbbbbbbccccccccddeddd
So assuming these... (19 Replies)
hi
I have 2 files to comapre ,in file a sible column it is numbers,in file b2 numbers and other values with coma separated.
i want compare numbers in file a with file b,and the out put put should be in C with numbers in both file a and b along with other columns of file b.
i used folowing... (7 Replies)
I have two text files which have records of thousand rows. Each row is having around 40 columns. Each column is tab delimited. Each row is delimited by newline character.
My requirement is to find for each row i need to find whether any column is different between the two files. For each row i... (8 Replies)
Hi i have 2 csv files a.csv and b.csv with the same number of columns and a list of values in both of it. Each and every individual value in both the files need to compared and if it matches then print correct in a new csv file otherwise print Incorrect
eg
a.csv
1,12/27/2007,Reward,$10.00... (5 Replies)
HI All, I have this wierd requirment. Any help will be appriciated.
I need to restrict file creation with certain pattern. Suppose, i want my system not to allow creation of files with *.exe extension. The requirment is that file should not be created like it happen in windows you can't create... (0 Replies)
now i have a different file zoo.txt with content
123|zoo
234|natan
456|don
and file rick.txt with contents
123|dog|pie|pep
123|tail|see|newt
456|som|sin|sim
234|pay|rat|cat
i want to look for lines in file zoo.txt column1 that has same corresponding lines in column 1 of... (6 Replies)
Dear All,
I would really appreciate if you can help me to resolve this file comparison
I have two files:
file1:
chr start end ID gene_name
chr1 2020 3030 1 test1
chr1 900 5000 2 test1
chr2 5000 8000 3 test2
chr3 6000 12000 4 test3
chr3 6000 15000 5 test3
file2:... (2 Replies)
HI,
I have two files and contains many Fields with | (pipe) delimitor, wanted to compare both the files and get only unmatched perticular fields. this i wanted to use in shell scriting.
ex:
first.txt
111 |abc| 230| hbc231 |bbb |210 |bbd405 |ghc |555 |cgv
second.txt
111 |abc |230 |hbc231... (1 Reply)
Hi,
I've created a user which shell is the restricted one (/usr/lib/rsh), but I've realized that the user cannot execute a script !!!
The scope was to allow the ssh access to a user that could not access to any other directories but there that user should be able to run a script that retrieves ... (2 Replies)
Discussion started by: mary0
2 Replies
LEARN ABOUT DEBIAN
device::modem::log::file
Device::Modem::Log::File(3pm) User Contributed Perl Documentation Device::Modem::Log::File(3pm)NAME
Device::Modem::Log::File - Text files logging plugin for Device::Modem class
SYNOPSIS
use Device::Modem;
my $box = Device::Modem->new( log => 'file', ... );
my $box = Device::Modem->new( log => 'file,name=/var/log/mymodem.log', ... );
...
DESCRIPTION
This is meant for an example log class to be hooked to "Device::Modem" to provide one's favourite logging mechanism. You just have to
implement your own "new()", "write()" and "close()" methods.
Default text file is "/var/log/modem.log". On Windows platforms, this goes into "%WINBOOTDIR%/temp/modem.log". By default, if the folder of
the log file does not exist, it is created.
This class is loaded automatically by "Device::Modem" class when an object is instantiated, and it is the default logging mechanism for
"Device::Modem" class.
Normally, you should not need to use this class directly, because there are many other zillions of modules that do logging better than
this.
Also, it should be pondered whether to replace "Device::Modem::Log::File" and mates with those better classes in a somewhat distant future.
REQUIRES
Device::Modem
EXPORTS
None
AUTHOR
Cosimo Streppone, cosimo@cpan.org
COPYRIGHT
(C) 2002 Cosimo Streppone, <cosimo@cpan.org>
This library is free software; you can only redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Device::Modem Device::Modem::Log::Syslog
perl v5.8.8 2005-04-30 Device::Modem::Log::File(3pm)