Sponsored Content
Full Discussion: File Difference Problem
Top Forums Shell Programming and Scripting File Difference Problem Post 302538432 by harish612 on Wednesday 13th of July 2011 02:33:11 AM
Old 07-13-2011
Amit,
You can also try with below code
But this will search the 3rdjuly.txt for each line of the 4thjuly.txt

For eg :
Even if the 4thjuly.txt line 2 and 3rdjuly.txt line 2 are not same but that line is present in 3rdjuly.txt then it won't be displayed in the output

Code:
rm -f  newfile.txt
while read line
do
  line1=`fgrep -ie "${line}" 3rdjuly.txt `
  if [ $? -ne 0 ] ; then
    echo "$line" >> newfile.txt
  fi
done <4thjuly.txt

In case you want to get the difference on each line of both the files you can refer to my above post i.e using diff command


Cheers
Harish
This User Gave Thanks to harish612 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Newbie question about difference between executable file and ordinary file

Hi, I am newbie in unix and just started learning it. I want to know what is the difference between an executable file and a file (say text file). How to create executable file? What is the extension for that? How to differentiate ? How does it get executed? Thanks (1 Reply)
Discussion started by: Balaji
1 Replies

2. Filesystems, Disks and Memory

Strange difference in file size when copying LARGE file..

Hi, Im trying to take a database backup. one of the files is 26 GB. I am using cp -pr to create a backup copy of the database. after the copying is complete, if i do du -hrs on the folders i saw a difference of 2GB. The weird fact is that the BACKUP folder was 2 GB more than the original one! ... (1 Reply)
Discussion started by: 0ktalmagik
1 Replies

3. Shell Programming and Scripting

compare 2 file and print difference in the third file URG PLS

Hi I have two files in unix. I need to compare two files and print the differed lines in other file Eg file1 1111 2222 3333 file2 1111 2222 3333 4444 5555 newfile 4444 5555 Thanks In advance (3 Replies)
Discussion started by: evvander
3 Replies

4. Shell Programming and Scripting

Weird date difference problem

I am trying to find the difference in days between 2 dates. I have to extract the 1st date from a filename, which i did using the awk command. I have to compare this date to today's date and if the difference is greater than 30 days, do something, else do something else. This is what i wrote... (22 Replies)
Discussion started by: meeraKh
22 Replies

5. Shell Programming and Scripting

Calculate the time difference between a local file and a remote file.

I m stuck with a issue. I need to calculate the time difference between two files.. one on the local machine and one on the remote machine using a script. Can any one suggest the way this can be achevied Thanks, manohar (1 Reply)
Discussion started by: meetmano143
1 Replies

6. Shell Programming and Scripting

Three Difference File Huge Data Comparison Problem.

I got three different file: Part of File 1 ARTPHDFGAA . . Part of File 2 ARTGHHYESA . . Part of File 3 ARTPOLYWEA . . (4 Replies)
Discussion started by: patrick87
4 Replies

7. Shell Programming and Scripting

Compare large file and identify difference in separate file

I have a very large system generated file containing around 500K rows size 100MB like following HOME|ALICE STREET|3||NEW LISTING HOME|NEWPORT STREET|1||NEW LISTING HOME|KING STREET|5||NEW LISTING HOME|WINSOME AVENUE|4||MODIFICATION CAR|TOYOTA|4||NEW LISTING CAR|FORD|4||NEW... (9 Replies)
Discussion started by: jubaier
9 Replies

8. UNIX for Beginners Questions & Answers

UNIX utility to find difference in folder, file and contents of file against a base version

Hi, I am trying to find out whether there are any Unix utilities that compares folders, files and contents within the file and provides a comprehensive report. The comparison can be against base version of a folder and file with content. Can you please let me know of such a utility? Thanks,... (6 Replies)
Discussion started by: Sripathi_ks
6 Replies

9. Shell Programming and Scripting

awk to calculate difference of split and sum the difference

In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13. I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

awk code to find difference in second file which is not present in first file .

Hi All, I want to find difference between two files and output only lines which are not present in second file .I am using awk and I am getting only the first difference but I want to get all the lines which are not present in file2 .Below is the code I am using . Please help to get the desired... (7 Replies)
Discussion started by: srinivasrao
7 Replies
RABBIT(1)							      rabbit								 RABBIT(1)

NAME
rabbit - presentation tool using RD, simple text format SYNOPSIS
rabbit [options] [SOURCE_INFOS] DESCRIPTION
Theme -I, --include=PATH Add [PATH] to load path. -t, --theme=THEME Use [THEME] as theme. (default) --comment-theme=THEME Use [THEME] for comment. () --allotted-time=TIME Use [TIME] as allotted time. () Source -T, --type=TYPE Specify source type as [TYPE]. Select from [auto, argf, file, memory, slideshare, uri]. Note: case insensitive. (auto) When select ARGF specify none (get from STDIN) or [FILE_NAMES] as [SOURCE_INFOS]. When select File specify [FILENAME] as [SOURCE_INFOS]. When select Memory specify [FILENAME_OR_NOT] as [SOURCE_INFOS]. When select SlideShare specify [USER] and [TITLE] as [SOURCE_INFOS]. When select URI specify URI as [SOURCE_INFOS]. -e, --encoding=ENCODING Specify source encoding as [ENCODING]. (auto) -B, --base=BASE Specify base URI or path of source as [BASE]. (auto) Initial state -f, --[no-]full-screen Toggle full screen mode. (off) --[no-]index-mode Toggle index mode. (off) Size -g, --geometry=GEOMETRY Set window geometry [GEOMETRY]. Format: WIDTHxHEIGHT+X+Y (nil) -w, --width=WIDTH Set window width to [WIDTH]. (800) -h, --height=HEIGHT Set window height to [HEIGHT]. (600) -S, --size=WIDTH,HEIGHT Set window width and height to [WIDTH] and [HEIGHT]. (800,600) Save -s, --save-as-image Save as image and exit. -i, --saved-image-type=TYPE Specify saved image type as [TYPE]. (png) -bBASE_NAME, Specify saved image base name as [BASE_NAME]. --saved-image-base-name (Title of slide) --saved-image-basename --[no-]output-html Output HTML for viewing saved images. (false) --[no-]output-index-html Output index HTML for navigating slides. (false) --rss-base-uri=URI Specify base URI of RSS as [URI]. RSS is generated only when HTML is output. () --source-filename=FILENAME Specify source filenam as [FILENAME]. () Print -p, --print Print and exit. -o, --output-filename=FILENAME Specify printed out filename as [FILENAME]. (#{Title of slide}.pdf) --slides-per-page=SLIDES Set slides per page. (1) --[no-]draw-scaled-image Draw scaled image. Better look for displaying but lesser look for printing. (true) Paper --paper-width=WIDTH Set paper width to [WIDTH] Pt. (landscape A4 width) --paper-height=HEIGHT Set paper height to [HEIGHT] Pt. (landscape A4 height) --paper-size=WIDTH,HEIGHT Set paper width and height to [WIDTH] Pt and [HEIGHT] Pt. (landscape A4 size) Margin --margin-left=MARGIN Set left margin for slides per page mode print. (auto) --margin-right=MARGIN Set right margin for slides per page mode print. (auto) --margin-top=MARGIN Set top margin for slides per page mode print. (auto) --margin-bottom=MARGIN Set bottom margin for slides per page mode print. (auto) --margin={ [ALL] | [TOP_BOTTOM],[LEFT_RIGHT] | [TOP],[LEFT_RIGHT],[BOTTOM] | [TOP],[RIGHT],[BOTTOM],[LEFT]} Set margin for slides per page mode print. --page-margin-left=MARGIN Set left page margin. (auto) --page-margin-right=MARGIN Set right page margin. (auto) --page-margin-top=MARGIN Set top page margin. (auto) --page-margin-bottom=MARGIN Set bottom page margin. (auto) --page-margin={[ALL]|[TOP_BOTTOM],[LEFT_RIGHT]|[TOP],[LEFT_RIGHT],[BOTTOM]|[TOP],[RIGHT],[BOTTOM],[LEFT]} Set page margin. dRuby --[no-]use-druby Specify whether to use dRuby. (true) --druby-uri=URI Specify dRuby URI. (druby://127.0.0.1:10101) --[no-]output-druby-uri Specify whether to output dRuby URI. (false) SOAP --[no-]use-soap Specify whether to use SOAP. (false) --soap-host=HOST Specify SOAP host as [HOST]. (0.0.0.0) --soap-port=PORT Specify SOAP port as [PORT]. (10103) XML-RPC --[no-]use-xmlrpc Specify whether to use XML-RPC. (false) --xmlrpc-host=HOST Specify XML-RPC host as [HOST]. (0.0.0.0) --xmlrpc-port=PORT Specify XML-RPC port as [PORT]. (10104) Server --[no-]server Specify whether to run as server. (false) Public level --public-level=LEVEL Specify public level. Select from the following: [ strict, move, read-size, change-size, size, read-source, change-source, source, control, all ] (all) Comment --comment-source=FILE Deprecated. Just ignored. Specify initial comment source. (default source) --comment-encoding=ENCODING Deprecated. Just ignored. Specify comment source encoding. (auto) Migemo --migemo-dictionary-search-path=PATH1,PATH2,... Specify search paths for Migemo static dictionary. (/usr/share, /usr/local/share) --migemo-dictionary-name=NAME Specify static dictionary name for Migemo. (migemo-dict) 3D --[no-]use-gl Specify whether to use OpenGL if available. (false) Display --[no-]keep-above Specify whether to keep above window. (false) Others --[no-]show-native-window-id Show a native window ID of the Rabbit window if available. e.g. The ID is the ID of X resource on X window system. (false) Common options --locale-dir=DIR Specify locale dir as [DIR]. (auto) --logger-type=TYPE Specify logger type as [TYPE]. Select from [stderr, gui]. (STDERR) --log-level=LEVEL Specify log level as [LEVEL]. Select from [debug, info, warning, error, fatal, unknown]. (info) --help Show this message. --version Show version. rabbit 1.0.7 June 2012 RABBIT(1)
All times are GMT -4. The time now is 01:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy