Giter VIP home page Giter VIP logo

doc2txt's Introduction

doc2txt

Build Status Coverage Status

A native Go reader for the old Microsoft Word .doc binary format files

Example usage:

f, _ := os.Open(`testData\simpleDoc.doc`)
buf, err := ParseDoc(f)
if err != nil {
  // handle error
}
// buf now contains an io.Reader which you can save to the file system or further transform

Special Thanks

A great big thank you to Richard Lehane. His (https://github.com/richardlehane/mscfb got me started, his https://github.com/richardlehane/doctool project got me closer and his answer to questions via email helped get me to the finish line. Thanks Richard!

doc2txt's People

Contributors

dcu avatar robarchibald avatar

Stargazers

Dongdong Yang avatar Kirill avatar Enrico Speranza avatar tsr avatar  avatar Lavenderain avatar Hunk Zhu avatar  avatar  avatar Florian Rohrweck avatar Breeze Chen avatar maplgebra avatar Doru Carastan avatar IBAS avatar Anthony Kava avatar Michael avatar Richard Lehane avatar

Watchers

Richard Lehane avatar James Cloos avatar liuweiguang avatar  avatar

doc2txt's Issues

Bug in translateText

There seems to be a bug in the translateText function at https://github.com/EndFirstCorp/doc2txt/blob/4f62ca5f11284a94bbf73a1b035381cf0888a79a/doc.go#L135

I believe the code should only output the 1 character that is processed:

buf.Write([]byte{b[cIndex]})

Otherwise it outputs again and again the whole buffer resulting into the same text multiple times and containing potentially control characters in the output.

In tests I had a ~100 KB Word file that resulted into 400 MB (!) of extracted text due to this bug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.