11-12-2007
Comparison of 2 files in UNIX
Hi, There are two files in UNIX system with some lines are exactly the same, some lines are not.
I want to compare these two files.The 2 files (both the files have data in
Column format )should be compared
row wise and any difference in data for a particular row should lead to storage of data of second file in another new third file.
i.e here we are assuming second file( file 2 ) to be updated version of first file (file 1) and any difference in row wise matching would lead to storage of the updated /modified data in another third file .
Please help me ASAP
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am very new to Unix. What are the similiarities and differences between ScoUnix and AIX5 if any? Where might i find the information? Which is better? (1 Reply)
Discussion started by: NewGuy100
1 Replies
2. Shell Programming and Scripting
Kindly help on follows.
I have 2 files. One file contains only one column of mobile numbers. And total records in a file 12 million. Second file contains 2 columns mobile numbers and balance. and total records 30 million. I want to find out balance of each data in file 1 corresponding to file 2.... (2 Replies)
Discussion started by: kamal_418
2 Replies
3. Shell Programming and Scripting
Hi,
I have a problem with comparison of two files
file1
20100101
20090101
20080101
20071001
20121229
file2
19990112 12 456 7
20011131 19
20100101 2 567 1 987
17890709 123 555
and, sh script needs to compare of these two files and give out to me result:
20100101 2 567 1 987
it... (5 Replies)
Discussion started by: shizik
5 Replies
4. Shell Programming and Scripting
Hello,
I have 2 files and I want them to be compared in a specific fashion
file1:
A_1200_1250
A_1251_1300
B_1301_1350
B_1351_1400
B_1401_1450
C_1451_1500 and so on...
file2:
1210 1305 1260 1295
1400 1500 1450 1495
Now The script should look for "1200" from A_1200_1250 of... (8 Replies)
Discussion started by: Diya123
8 Replies
5. Shell Programming and Scripting
Hi all
I have two files which I have to compare that whetehr there is soemthing common or not
body, div, table, thead, tbody, tfoot, tr, th, td, p { font-family: "Liberation Sans"; font-size: x-small; }
body, div, table, thead, tbody, tfoot,... (2 Replies)
Discussion started by: manigrover
2 Replies
6. Shell Programming and Scripting
Hi all,
I want to compare two files with same number of rows and columns with records in same order.
Just want to highlight the differences in the column values if any.
file A
1,kolkata,19,ab
2,delhi,89,cd
3,bangalore,56,ef
file2:
1,kolkata,21,ab
2,mumbai,89,gh
3,bangalore,11,kl... (9 Replies)
Discussion started by: prabhat.diwaker
9 Replies
7. Shell Programming and Scripting
Hi All ,
As I am new to unix scripting ,I need a help regarding unix scripting .I have two .txt files .One is source file and another is target file.I need a script through which I can compare those two files.I need a automated comparison report in a directory after comparing between source &... (2 Replies)
Discussion started by: STCET22
2 Replies
8. Shell Programming and Scripting
Hi All ,
I am aware of unix command ,but not comforable in putting together in script level.I came to situation where I need to compare between two .txt files fieldwise and need a mismatch report. As I am new to unix script arena ,if anyone can help in the below scenario that will be really... (9 Replies)
Discussion started by: STCET22
9 Replies
9. Shell Programming and Scripting
I have two files which has component name and version number separated by a space
cat file1
com.acc.invm:FNS_PROD 94.0.5
com.acc.invm:FNS_TEST_DCCC_Mangment 94.1.6
com.acc.invm:FNS_APIPlat_BDMap 100.0.9
com.acc.invm:SendEmail 29.6.113
com.acc.invm:SendSms 12.23.65
cat file2 ... (8 Replies)
Discussion started by: rakeshtomar82
8 Replies
10. Shell Programming and Scripting
I have the requirement
I have two files
cat fileA
something
anythg
nothing
everythg
cat fileB
everythg
anythg
Now i shld use fileB and compare every line at fileA and get the output as
something
nothing (3 Replies)
Discussion started by: Priya Amaresh
3 Replies
LEARN ABOUT DEBIAN
root-tail
ROOTTAIL(1) General Commands Manual ROOTTAIL(1)
NAME
root-tail - print text directly to X11 root window
SYNOPSIS
root-tail [-g|--geometry GEOMETRY] [-fn|--font FONTSPEC] [--color color] [--reload SEC COMMAND] [--shade] [--outline] [--minspace]
[--noflicker] [-f|--fork] [--reverse] [--whole] [--partial] [--update] [--cont STRING] [--wordwrap] [--justify] [--noinitial] [--frame]
[-id ID] [-i|--interval SECONDS] [-V] file1[,color[,desc]] [file2[,color[,desc]]]
DESCRIPTION
Displays a given file anywhere on your X11 root window, i.e. it is kind of tail -f for multiple files using your desktop background as out-
put window.
All non-option arguments on the command line are files to be logged. A null desc (example: "/var/log/messages,red,") will prevent the
printing of a description and the []'s.
General Options
--color COLOR
Use COLOR as default.
--font | -fn FONTSPEC
Use font FONTSPEC. This can be either a fixed width font like -fn fixed or any font using -fn '-*-*-*-*-*-*-*-*-*-*-*-*-*-*' with
the appropriate fields filled out (see xfontsel). Specifying a different FONTSPEC before each filename will cause each file to be
displayed in a different font.
-f | --fork
Forks to the background.
--reverse
Display the files in reverse order, with the newest lines at the top.
--whole
Only display whole lines. If the last line of a file doesn't yet end with a newline character then wait until it does before dis-
playing it. This is the default if more than one file is being displayed.
--partial
This is the opposite of the --whole option (see above). It displays lines even if they don't yet have a newline at the end. This is
the default if only one file is being displayed.
--update
Update partial lines 'in place' if they are still on the screen when they are updated in their files. Using --update automatically
turns on --partial.
--cont STRING
When partial lines are broken into two lines in the display, prefix the 2nd line with STRING. Defaults to "|| ". Specify the
"--whole" argument to ensure partial lines are never displayed, or specify "--update" to attempt to "repair" broken lines in-place.
--cont-color COLOR
Use COLOR when displaying the continuation string (as optionally specified with the --cont option above).
--wordwrap
The default behaviour is to fit as much as possible onto each line of output, even if this means splitting a word between one line
and the next. The --wordwrap argument splits lines at spaces if possible.
--justify
After wrapping long lines, attempt to justify the text to produce a smooth right-hand margin. Implies --wordwrap.
--reload SEC COMMAND
Re-display the file(s) and run COMMAND every SEC seconds. The default is to never re-display the file(s).
--shade
Add black shading to the font.
--outline
Add a black outline to the font (making redraws quite a bit slower).
--minspace
Use minimum linespace even when using shading or outlining. This might result in leftover pixels (dependign on font and logfile con-
tent).
--noflicker
Use slower but flicker-free update.
--noinitial
Don't display the end of the file(s) initially.
-id ID Use the given window ID for output instead of the root window.
-i | --interval SECONDS
Use the specified sleeping interval between checks instead of the default 2.4 seconds. Fractional values are OK.
-V Print version information.
--frame
Draw a frame around the selected area. This is useful when trying to find the perfect geometry.
EXAMPLE
root-tail -g 800x250+100+50 -font 10x20 /var/log/messages,green -font 12x24 /var/log/secure,red,'ALERT'
BUGS
Some desktop environments open a virtual root window and make it difficult to share it. If you cannot see anything after starting root-
tail, try to find a setting "allow programs on desktop" or similar, or manually specify a window id.
Should you happen to find any bugs please fix them and send me a diff.
NOTE: This program was modified by Marc Lehmann <pcg@goof.com>, who couldn't reach the original author. Please direct bug-reports etc. to
pcg@goof.com.
http://root-tail.plan9.de/
4.2 Berkeley Distribution 2004-03-27 ROOTTAIL(1)