473,327 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

diff command in unix

snowfall
I need to find the difference of two files and save it in third file and process it..
But the outpur of diff command is coming with the 'line number - difference' code.

Eg of my output

i22,26d21
< Use the bc program to convert from decimal to hexadecimal.
< To do so, use the obase command to set the base for output:
39c34,35
< See Section 5.6 for more examples of using bc.

But i want only the lines and not the 'i22,26d21 & < Symbol'..

Pls help..

TIA
Mar 13 '08 #1
4 3810
docdiesel
297 Expert 100+
Hi,

if you just need the lines, means their content, you could get them with

Expand|Select|Wrap|Line Numbers
  1. diff .... | grep ^\< | sed s/^\<\ //
But this doesn't give you the information, which line is new nor which one's changed or deleted.

Regards,

Bernd
Mar 13 '08 #2
Hi,

if you just need the lines, means their content, you could get them with

Expand|Select|Wrap|Line Numbers
  1. diff .... | grep ^\< | sed s/^\<\ //
But this doesn't give you the information, which line is new nor which one's changed or deleted.

Regards,

Bernd
Sorry i dont understand.. Is the syntax like this??

Expand|Select|Wrap|Line Numbers
  1. diff file1 file2 > outfile | grep ^\< | sed s/^\<\ //
pls help...
Mar 13 '08 #3
docdiesel
297 Expert 100+
Hi,

for just getting the new/changed/deleted lines use

Expand|Select|Wrap|Line Numbers
  1. diff  file1.txt file2.txt | grep ^\< | sed s/^\<\ //
If you need the differences in diff.txt, use
Expand|Select|Wrap|Line Numbers
  1. diff  file1.txt file2.txt | tee diff.txt | grep ^\< | sed s/^\<\ //
Regards,

Bernd
Mar 13 '08 #4
Hi,

for just getting the new/changed/deleted lines use

Expand|Select|Wrap|Line Numbers
  1. diff  file1.txt file2.txt | grep ^\< | sed s/^\<\ //
If you need the differences in diff.txt, use
Expand|Select|Wrap|Line Numbers
  1. diff  file1.txt file2.txt | tee diff.txt | grep ^\< | sed s/^\<\ //
Regards,

Bernd
Thanks Bernd............................................. .......
Mar 14 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Guillaume Lahitette | last post by:
Hello everyone, I am looking for a lightweight Java Applet to diff and merge two text files. The functionality would be a subset of what WinMerge (http://winmerge.sourceforge.net) offers: -...
3
by: Nick Allen | last post by:
After using ndiff from difflib, the function restore would return the sequence that generated the delta. Unfortunately, restore does not do the same for unified_diff. I do not see any similar...
1
by: Mark Steinberger | last post by:
Where can I get a perl implementation of the unix diff utility? Mark
6
by: Lionel van den Berg | last post by:
Hi all, I'm wondering if there is a diff function like the unix command in C++? In fact I would like to know if you can call the unix (I should say *nix) command from within a c++ application?...
5
by: Anil | last post by:
Hi, I have a HTML webpage that is updated every week. I mean the layout gets chaged every week(not a very drastic change). Like, edit box is changed to drop down menu or a field is moved from...
8
by: TonyHa | last post by:
Hello, Does any one have using Python to write a Unix "diff" command for Window? Tony Ha.
2
by: Steve Manes | last post by:
My company offers an ASP service for advertising companies using PG. For contractual reasons, each client gets its own replicated database. This presents a problem whenever a new feature/fix...
6
by: Igor Shevchenko | last post by:
Hi! Suppose I have "pg_dump -s" of two pg installs, one is "dev", another is "production". Their schemas don't differ too much, and I want to get a "diff -u"-like schema diff so I can quickly...
3
by: AirYT | last post by:
Hello, I'm looking for an implementation for diffing 2 (text) files and spitting out the output using php only. i would like to extend this to use ftp to diff two files on two ftp servers, or...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.