cat

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: Unlicense Imports: 6 Imported by: 6

README

GoDoc License CircleCI Go Report Card codecov

cat

This is a simple libary to extract text from plaintext, .docx, .odt, .pdf and .rtf files.

Install

go get -u github.com/lu4p/cat

Basic Usage

package main
import (
  "fmt"
  "github.com/lu4p/cat"
)

func main(){
  txt, _ := cat.File("filename")
  fmt.Println(txt)
}

Documentation

Overview

Package cat extracts text from multiple document formats

Example
package main

import (
	"fmt"

	"github.com/lu4p/cat"
)

func main() {
	txt, _ := cat.File("./test/test.docx")
	fmt.Println(txt)
}
Output:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id ex nec risus venenatis viverra. Cras condimentum dolor vitae dictum rutrum. Etiam viverra sit amet mi at lacinia.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(filename string) (string, error)

File reads a .odt, .docx, .rtf or plaintext file and returns the content as a string

func FromBytes

func FromBytes(data []byte) (string, error)

FromBytes converts a []bytes representation of a document to text

Types

This section is empty.

Directories

Path Synopsis
cmd
cat
Package docxtxt extracts text from .docx documents
Package docxtxt extracts text from .docx documents
Package odtxt extracts text from .odt documents
Package odtxt extracts text from .odt documents
Package plaintxt extracts text from plaintext documents
Package plaintxt extracts text from plaintext documents
Package rtftxt extracts text from .rtf documents
Package rtftxt extracts text from .rtf documents

Jump to

Keyboard shortcuts

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