How to create a new CSV of only Changes in two CSV database export files?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • p8092040
    New User
    • Jun 2017
    • 1

    How to create a new CSV of only Changes in two CSV database export files?

    I need to extract ONLY differences between two CSV (Character Separated Values) files into a 3rd file. For instance,

    File1 is an older version of an exported database in CSV with tab separators and one record per line.

    File2 is a recent export of the same database into CSV, also with tab separators and one record per line. It has additions, changes and deletions. This file is sorted the same as File1.

    Objective: I need to create a 3rd CSV file that contains entire lines (records) of the changes detected in File2. This way, I end up with File3 which represents all the changes from File1 to File2.

    So far, I have installed the most recent version of the BeyondCompare ("BC") tool help me with the above scenario and objective.

    I understand the entire process, to reach my objective File3 with ONLY changes, is not fully automated.
    I'm finding it difficult to find the features or functions in BC to accomplish this.
    How can I accomplish these steps? I would appreciate some guidance on which menu items, mouse clicks or keystrokes I need to use to create my objective File3?
    1. How do I set a column in both File1 and File2 CSVs to represent the key field?
    2. Once a key field is set, can I sort all records (lines) in File1 and File2? How?
    3. How do I enable a filter to view ONLY changes in File2?
    4. How do I create the File3 (objective of this exercise) to contain ONLY the changes identified in File2?



    Thank you.
  • Aaron
    Team Scooter
    • Oct 2007
    • 15995

    #2
    Hello,

    1. You can right click any column header to set as Key, Standard, or Unimportant. Or in the Session menu -> Session Settings, Columns tab, and edit the column to set as Key.

    2. By default, rows are sorted by Key, unless you change the Session Settings, Alignment tab.

    3. The Display Filters can Show Differences. Or right-click and set to Toggles mode, then enable Display Filters to Show Left Differences, Show Right Differences, or Show Differences (aligned equal key but with other differences in the row).

    4. You can set the toggles Display Filter to show the specific changes you need, Select All, then Copy/Paste into Excel. BC4 itself does not have a Report export to CSV. Another option would be to Edit the Right side until it contains only the rows needed for File3 then *carefully* perform a Save As to create a third file.
    Aaron P Scooter Software

    Comment

    Working...