csv_converter

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

README

GoDoc Go Report Card

import github.com/baraa-almasri/csv_converter

TODO

add more readme!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVConverters

type CSVConverters interface {
	ConvertFromCSV(csvFile io.Reader) string
	ConvertToCSV(targetFile io.Reader) string
}

type HTMLConverter

type HTMLConverter struct{}

func NewHTMLConverter

func NewHTMLConverter() *HTMLConverter

NewHTMLConverter returns a csv <-> html converter

func (*HTMLConverter) ConvertFromCSV

func (this *HTMLConverter) ConvertFromCSV(csvFile io.Reader) string

ConvertFromCSV converts a given csv file into an html formatted document that has a table containing the data from the csv file, by magic well no by putting all the csv data inside a nice looking html table

func (*HTMLConverter) ConvertToCSV

func (this *HTMLConverter) ConvertToCSV(htmlFile io.Reader) string

ConvertToCSV converts a given html file into a csv string by splitting the html string by "<t" ie the start of <tr>, <td>, or <th> also no other tags has 'r', 'd', or 'h' as the second char in it that after the closing triangular parenthesis exist some actual data

type MarkdownConverter

type MarkdownConverter struct{}

func NewMarkdownConverter

func NewMarkdownConverter() *MarkdownConverter

NewMarkdownConverter returns a csv <-> md converter

func (*MarkdownConverter) ConvertFromCSV

func (this *MarkdownConverter) ConvertFromCSV(csvFile io.Reader) string

ConvertFromCSV converts a given csv file into an md formatted string with the data from the csv file by adding elements between pipes md is amazing isn't it??

func (*MarkdownConverter) ConvertToCSV

func (this *MarkdownConverter) ConvertToCSV(markdownFile io.Reader) string

ConvertToCSV converts a given md file into a csv string by splitting the md string into lines then splitting the lines by pipes then appending each entry into the resulting csv string

Jump to

Keyboard shortcuts

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