HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: comparing files
Operating System - HP-UX
1834711
Members
2564
Online
110069
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 07:19 AM
10-11-2002 07:19 AM
comparing files
Hi,
I just need to compare two files and i want output as lines which are not common to both files.I tried diff and comm.I did not get what i want.Any help.?
Thanks
I just need to compare two files and i want output as lines which are not common to both files.I tried diff and comm.I did not get what i want.Any help.?
Thanks
unix4me
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:05 AM
10-11-2002 08:05 AM
Re: comparing files
comm requires the input files to be sorted
if both files have unique keys, you can start experimenting with 'join'
perl offers several modules that deal with diff formats or do the diff themselves. Text::Diff is the first that comes to mind. enter diff as search criterium on search.cpan.org
if both files have unique keys, you can start experimenting with 'join'
perl offers several modules that deal with diff formats or do the diff themselves. Text::Diff is the first that comes to mind. enter diff as search criterium on search.cpan.org
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:06 AM
10-11-2002 08:06 AM
Re: comparing files
Have you tried using comm twice, firstly using comm -23 file1 file2, then using comm -13 file1 file2.
This will take the lines that are only in 1 file, then the lines that are only in the other file. You should use > in the first command to redirect the output into a new file, then >> to append the result of the 2nd file.
Don't forget to use sort first
This will take the lines that are only in 1 file, then the lines that are only in the other file. You should use > in the first command to redirect the output into a new file, then >> to append the result of the 2nd file.
Don't forget to use sort first
I didn't do it. He did!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2002 08:23 AM
10-11-2002 08:23 AM
Re: comparing files
Please note the author has submitted this question twice - here's the other thread: http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7d58b10230dcd61190050090279cd0f9,00.html
regards,
Darren.
regards,
Darren.
Calm down. It's only ones and zeros...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP