Categorygithub.com/ribeirohugo/go_md5_matcher
repository
1.0.0
Repository: https://github.com/ribeirohugo/go_md5_matcher.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

Go Md5 Matcher

Md5 matcher tool using Golang.

1. Run Commands

Start application by running the following command:

run ./cmd/console/main.go

2. Configurations

Configurations must be loaded by setting values at config.toml in the main project path.

ParameterDescriptionTypeDefaultRequired
encoded_columnEncoded column field to be added into the output file.int-1NO
output_nameOutput file name with match results.string<current_timestamp>.csvNO
[data_csv]Add a CsvFile config concerning the following topic.CsvFile YES
[data_encoded]Add a CsvFile config concerning the following topic.CsvFile YES

2.1. Csv File

ParameterDescriptionTypeDefaultRequired
field_delimiterField character that delimits row fields. Usually is ; or , .string;NO
file_pathCsv file path.string YES
match_columnCsv file column that will be used as match comparison. Counting starts with 0.int0NO
start_lineCsv line number that will be used to start comparison. Counting starts with 0.int0NO

3. Guidelines

Instantiate CsvFile structs for the data CSV file and for the CSV file with the encoded fields.

matcher.CsvFile{
    Delimiter: ';',
    FilePath: 'data.csv',
    MatchColumn: 3,
}

3.1. Instantiate Csv Matcher

Instantiate a Csv Matcher by running NewCsvMatcher method. Insert two CsvFile structs: one for Csv data file; and the other one for the encoded data Csv.

matcher.NewCsvMatcher(
    matcher.CsvFile{
        Delimiter: ';',
        FilePath: "data.csv",
        MatchColumn: 3,
        StartLine: 1,
    },
    matcher.CsvFile{
        Delimiter: ';',
        FilePath: "md5.csv",
        MatchColumn: 2,
        StartLine: 1,
    },
    "fileName.csv",
    0
)

3.2. Run Matcher

After instantiate a CsvMatcher struct, you may run Match() method as in the following excerpt.

matchStruct := matcher.NewCsvMatcher( [...] )

err := matchstruct.Match()

It will generate a new Csv file with the data file rows that matched with the encoded ones.