Please note that LinuxExchange will be shutting down on December 31st, 2016. Visit this thread for additional information and to provide feedback.

Hi, I have to compare two .csv files and get the output in other file in the given format.

First column in provided files would be unique.

If a new line is added I want A followed by "," and then followed by entire new row. If a line is modified I want C followed by "," and then followed by entire modified row. If a line is deleted I want D followed by "," and then followed by entire deleted row.

File 1

aa, bb, cc, dd, ee

bb, ww, ee, tt, yy

cc, vv, vv, vv, vv

File 2 bb, ww, ee, tt, y1

cc, vv, vv, vv, vv

nn, bb, nn, cc, bb

So output be like

D, aa, bb, cc, dd, ee

C, bb, ww, ee, tt, y1

A, nn, bb, nn, cc, bb

asked 18 Sep '14, 03:10

apoorva%20joshi's gravatar image

apoorva joshi
1113
accept rate: 0%

edited 18 Sep '14, 03:14

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×90
×6

Asked: 18 Sep '14, 03:10

Seen: 7,988 times

Last updated: 18 Sep '14, 03:14

powered by OSQA