Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 01-20-2009, 12:51 AM   #1
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: 1 name:aaaaaa
city:abcd 2 name:aaabbb
city:abcd 1 name:aaaccc

File 2: 1 name:lmnopq
city:abcd 2 name:abcdef
city:abcd 1 name:ijklmn

I want to check which fields are varrying form File1 to File2.
length of, 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
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
Welcome to LQ.

Try using 'diff' as a starting point.

diff file1 file2


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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:26 AM.

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