godiff

command module
v0.0.0-...-5735d38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2020 License: GPL-2.0 Imports: 25 Imported by: 0

README

godiff

A File/Directory diff-like comparison tool with HTML output. Enhanced to support CSV files with Primary/Combinational Keys

This program can be use to compare files and directories for differences. When comparing directories, it iterates through all files in both directories and compare files having the same name.

See example output here:

How to use godiff - general all files

godiff file1 file2 > results.html
godiff directory1 directory > results.html

How to use godiff - csv files

* Compare csv files with primary key
godiff -key <CaseSensitive-Column-name> file1 file2
* Compare csv files with combinational keys
 godiff -key <CommaSeperatedCaseSensitive-Column-names> file1 file2
* Output diff files to different name / folder
 godiff -csv <diff-csv-file-name> -html <diff-html-file-name> -diff-dir <output-dir> -key <column-name> file1 file2
* Measure the time taken to generate diff files
 godiff -timeit -key <Column-name> file1 file2

See godiff -h for all the available command line options

Features

  • When comparing two directory, place all the differences into a single html file.
  • Supports UTF8 file.
  • Show differences within a line
  • Options for ignore case, white spaces compare, blank lines etc.
  • Compare csv files and generate diff csv file
  • Compare csv files with single / combinational primary keys
  • CSV files Columns / Rows can be any order
  • Measure time taken to create diff files
  • Diff files can be saved in different folder

Description

I need a program to to compare 2 directories, and report differences in all files. Much like gnudiff, but with a nicer output. And I also like to try out the go programming language, so I created godiff.

The diff algorithm implemented here is based on "An O(ND) Difference Algorithm and its Variations" by Eugene Myers Algorithmica Vol. 1 No. 2, 1986, p 251.

godiff always tries to produce the minimal differences, just like gnudiff with the "-d" option.

Go Language

This program is created in the go programming language. For more information about go, see golang.org

How to Build

On Linux or Darwin OS

go build -o godiff godiff.go godiff_unix.go

On Windows

go build -o godiff.exe  godiff.go godiff_windows.go

Prebuild Binary for Windows

https://github.com/rsrini7/godiff/releases/download/snapshot/godiff3.7z

Documentation

Overview

File/Directory diff tool with HTML output
Copyright (C) 2012   Siu Pin Chao

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Description:

This program can be use to compare files and directories for differences.
When comparing directories, it iterates through all files in both directories
and compare files having the same name.

It uses the algorithm from "An O(ND) Difference Algorithm and its Variations"
by Eugene Myers Algorithmica Vol. 1 No. 2, 1986, p 251.

Main Features:

  • Supports UTF8 file.
  • Show differences within a line
  • Options for ignore case, white spaces compare, blank lines etc.

Main aim of the application is to try out the features in the go programming language. (golang.org)

  • Slices: Used extensively, and re-slicing too whenever it make sense.

  • File I/O: Use Mmap for reading text files

  • Function Closure: Use in callbacks functions to handle both file and line compare

  • Goroutines: for running multiple file compares concurrently, using channels and mutex too.

    History ------- 2012/09/20 Created

Directories

Path Synopsis
Some additional utilities that are useful when processing CSV headers and data.
Some additional utilities that are useful when processing CSV headers and data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL