goword

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

README

goword

Release Quality test License GoDoc

Go Package to extract text from word docx files

usage
import (
    "fmt"
    "github.com/frederikhs/goword"
    "log"
)

func main() {
    text, err := goword.ParseText("1.docx")
    if err != nil {
        log.Panic(err)
    }
    fmt.Println(text)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseText

func ParseText(filename string) (string, error)

Types

type Paragraph

type Paragraph struct {
	Style Style `xml:"pPr>pStyle"`
	Rows  []Row `xml:"r"`
}

type Row

type Row struct {
	Text string `xml:"t"`
}

type Style

type Style struct {
	Val string `xml:"val,attr"`
}

type WordDocument

type WordDocument struct {
	Paragraphs []Paragraph
}

func Parse

func Parse(doc string) (WordDocument, error)

func (WordDocument) AsText

func (w WordDocument) AsText() string

Jump to

Keyboard shortcuts

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