06-30-2010
Scan two files and print values missing
Dear Experts,
Have been seraching this forum from this morning for my query but dint find hence posting it her... Basically i have two input files BSS and MSS which has a unique string , hence i hav tried and seperated the text to compare frm both files .. Any my present input files look like below:
HTML Code:
File1
40468006A2027
40468006A2028
40468006A2029
40468006A7577
40468006A7578
40468006A7579
HTML Code:
File2
40468006A210D
40468006A210E
40468006A210F
40468006A7577
40468006A7578
40468006A7579
40468111222
40468abcabd
Here each line of file1 should be scanned with File2 , similarly vice versa and my output should be
HTML Code:
Data Missing in File2 which exist in File1:
40468006A2027
40468006A2028
40468006A2029
Data Missing in File1 which is present in File2:
40468006A210D
40468006A210E
40468006A210F
40468111222
40468abcabd
Tried comm grep diff , nothing basically works as loop is required to search each value against all lines... Please help me in this regard
Thanks in Advance
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everyone,
Please help on this:
I have file1:
<file title="Title 1 and 2">
<report>
<title>Title 1</title>
<number>No. 1234</number>
<address>Address 1</address>
<date>October 07, 2009</date>
<description>Some text</description>
</report>
... (6 Replies)
Discussion started by: Ophiuchus
6 Replies
2. Shell Programming and Scripting
Hi All,
I have 100 .txt files which look like this:
3
4
5
6
7
Now, some files have some numbers missing in them and they look like this:
4
5
6 (6 Replies)
Discussion started by: shoaibjameel123
6 Replies
3. Shell Programming and Scripting
Hello all,
I have several directories with a sequence of files like this
IM-0001-0001.dcm
IM-0001-0002.dcm
IM-0001-0003.dcm
IM-0001-0004.dcm
IM-0001-0005.dcm
I would like to print out the name of the file that is missing.
I currently have the following ineffecient way to do this... (4 Replies)
Discussion started by: avatar_007
4 Replies
4. Shell Programming and Scripting
- I have two files (File 1 and File 2) and the contents of the files are mentioned below.
- I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2.
- I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have to text files that I want to merge by the first column. The values in the first column pretty much match for the first part. However there are some values that are present in column 1 and not present in column 2 or vice versa. For such values I would like to substitute X for the... (9 Replies)
Discussion started by: evelibertine
9 Replies
6. Shell Programming and Scripting
Hi, please help with this, I need to insert missing values into a matrix for a regression analysis.
I have made up an example. The first three columns are variables with levels and the next 3 are values, the 4th column missing values should be replaced by 0s, and 5th and 6th column missing... (3 Replies)
Discussion started by: ritakadm
3 Replies
7. Shell Programming and Scripting
Hi,
I have 5 files with two columns. I need to merge all the 5 files based on column 1. If any of them are missing then corresponding 2nd column should be substituted by missing value.
I know hoe to do this for 2 files. but how can I implement for 5 files. I tried this based on 5 files but it... (2 Replies)
Discussion started by: Diya123
2 Replies
8. Shell Programming and Scripting
Hi,
I have a data sample as shown below. I want to fill in the left column so that the line will be continuous. For example, between 1 and 5 should be 2,3,4. And corresponding values in the right column will be 0. Thus the expected data should look like that:
1 1
1 10
1 2
1 3
1 5
1 6
2 0... (6 Replies)
Discussion started by: theanh0508
6 Replies
LEARN ABOUT DEBIAN
text::worddiff::html
Text::WordDiff::HTML(3pm) User Contributed Perl Documentation Text::WordDiff::HTML(3pm)
Name
Text::WordDiff::HTML - XHTML formatting for Text::WordDiff
Synopsis
use Text::WordDiff;
my $diff = word_diff 'file1.txt', 'file2.txt'; { STYLE => 'HTML' };
my $diff = word_diff $string1, $string2, { STYLE => 'HTML' };
my $diff = word_diff *FH1, *FH2, { STYLE => 'HTML' };
my $diff = word_diff &reader1, &reader2, { STYLE => 'HTML' };
my $diff = word_diff @records1, @records2, { STYLE => 'HTML' };
# May also mix input types:
my $diff = word_diff @records1, 'file_B.txt', { STYLE => 'HTML' };
Description
This class subclasses Text::WordDiff::Base to provide a XHTML formatting for Text::WordDiff. See Term::WordDiff for usage details. This
class should never be used directly.
Text::WordDiff::HTML formats word diffs for viewing in a Web browser. The diff content is highlighted as follows:
o "<div class="file">"
This element contains the entire contents of the diff "file" returned by "word_diff()". All of the following elements are subsumed by
this one.
o "<span class="fileheader">"
The header section for the files being "diff"ed, usually something like:
--- in.txt Thu Sep 1 12:51:03 2005
+++ out.txt Thu Sep 1 12:52:12 2005
This element immediately follows the opening "file" "<div>" element, but will not be present if Text::WordDif cannot deterimine the
file names for both files being compared.
o "<span class="hunk">"
This element contains a single diff "hunk". Each hunk may contain the following elements:
o "<ins>"
Inserted content.
o "<del>"
Deleted content.
You may do whatever you like with these elements and classes; I highly recommend that you style them using CSS. You'll find an example CSS
file in the eg directory in the Text-WordDiff distribution.
See Also
Text::WordDiff
Text::WordDiff::ANSIColor
Support
This module is stored in an open repository at the following address:
<https://svn.kineticode.com/Text-WordDiff/trunk/>
Patches against Text::WordDiff are welcome. Please send bug reports to <bug-text-worddiff@rt.cpan.org>.
Author
David Wheeler <david@kineticode.com>
Copyright and License
Copyright (c) 2005-2008 David Wheeler. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.0 2009-09-24 Text::WordDiff::HTML(3pm)