LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-20-2009, 12:51 AM   #1
surya_gadde
LQ Newbie
 
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
how can I differentiate two large text files using shell script? Files are like below


I want to automate this using script.How to automate it?

File1:

s.no# 1 name:aaaaaa
city:abcd

s.no# 2 name:aaabbb
city:abcd

s.no# 1 name:aaaccc
city:abcd
.
.
.
.
.


File 2:

s.no# 1 name:lmnopq
city:abcd

s.no# 2 name:abcdef
city:abcd

s.no# 1 name:ijklmn
city:abcd
.
.
.
.
.

I want to check which fields are varrying form File1 to File2.
length of S.no, name and city are same.

Last edited by surya_gadde; 01-20-2009 at 11:59 PM.
 
Old 01-20-2009, 02:52 AM   #2
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Welcome to LQ.

Try using 'diff' as a starting point.

Code:
diff file1 file2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enable text color to differentiate files and directories? Akhran *BSD 4 07-15-2008 10:06 PM
differentiate text files packets Programming 3 01-30-2008 08:40 PM
Text editor for large files PMorph Linux - Software 1 07-17-2007 08:07 AM
sed with large text files? apollyonus Linux - Server 3 03-22-2007 07:33 AM
Script file to replace large text blocks in files? stodge Linux - Software 0 09-27-2003 10:53 AM


All times are GMT -5. The time now is 09:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration