csvconv

package
v0.0.0-...-a5d261b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVConverter

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

CSVConverter is an interface that can be used as any CSV converter

type HTMLConverter

type HTMLConverter struct{}

HTMLConverter is a CSV, HTML bidirectional converter

func NewHTMLConverter

func NewHTMLConverter() *HTMLConverter

NewHTMLConverter returns a csv <-> html converter

func (*HTMLConverter) ConvertFromCSV

func (h *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 (h *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{}

MarkdownConverter is a CSV, Md bidirectional converter

func NewMarkdownConverter

func NewMarkdownConverter() *MarkdownConverter

NewMarkdownConverter returns a csv <-> md converter

func (*MarkdownConverter) ConvertFromCSV

func (m *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 (m *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