Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-17-2009, 01:19 AM   #1
LQ Newbie
Registered: Feb 2009
Posts: 1

Rep: Reputation: 0
Post Shell Script for CSV file comparision

I have 2 CSV files. let say emp_data_Jan.csv (will contain the data of employees till Jan) and emp_data_feb.csv (will contain the data of employees till Feb). I need a Shell script which can read both these files and compare the data between emp_data_Jan.csv and emp_data_feb.csv. After comparision i need the output data in new CSV file. Output data will be records which are present in emp_data_Feb.csv and not in emp_data_Jan.csv. Can any one help me on this.

Thanks in Advance

Old 02-17-2009, 03:33 AM   #2
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Try reading 'man comm', I believe comm in the program you need for this. Probably something like:

comm -1 emp_data_Feb.csv emp_data_Jan.csv > new.csv


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
.csv file upoload, manipulation, download script help donv2 Programming 6 12-19-2007 03:20 PM
Calculate average from csv file in shell script khairilthegreat Linux - Newbie 5 11-21-2007 12:57 PM
Filtering a CSV file from web log with shell script? Micro420 Programming 8 08-22-2007 03:13 AM
shell script to read input from csv ip addresses? kr0m3 Programming 3 07-21-2007 08:51 AM
Shell script to read from csv file hendemeg Programming 1 05-11-2004 08:23 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration