csvconv

package module
v0.0.0-...-acc9233 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/csvconv"

TODO

add more readme!

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 interface that can be casted down to any other 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