xlstotext

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFromPath

func ExtractFromPath(path string) (string, error)

ExtractFromPath extracts text by "xlstotext" cmd from the given xls file path.

Parameters: - path: the xls file path to extract text from.

Returns: - string: the extracted text. - error: any error that occurred during the extraction process.

func ExtractFromPathByTika

func ExtractFromPathByTika(path string, tikaServerURL string) (string, int, error)

ExtractFromPathByTika extracts text content from a xls file specified by the given path using the Tika server located at the provided URL.

Parameters:

  • path: The path to the xls file.
  • tikaServerURL: The URL of the Tika server.

Returns:

  • string: The extracted text content.
  • int: the HTTP status code from Tika server.
  • error: An error if any occurred during the extraction process.

func ExtractFromReader

func ExtractFromReader(r io.Reader) (string, error)

ExtractFromReader extracts text data from an io.Reader.

It reads the data from the provided io.Reader and stores it in a temporary file. Then it uses the "xlstotext" command to extract the text from the temporary file. The extracted text is returned as a string.

Parameters:

  • r: An io.Reader from which the data will be read.

Returns:

  • string: The extracted text.
  • error: An error if any occurred during the extraction process.

func ExtractFromReaderByTika

func ExtractFromReaderByTika(r io.Reader, size int, tikaServerURL string) (string, int, error)

ExtractFromReaderByTika extracts text data from a reader using Tika server.

Parameters:

  • r: an io.Reader representing the input data.
  • size: an int representing the size of the input data.
  • tikaServerURL: a string representing the URL of the Tika server.

Returns:

  • string: the extracted data.
  • int: the status code of the Tika server response.
  • error: an error, if any occurred.

func ExtractFromURL

func ExtractFromURL(u string) (string, int, error)

ExtractFromURL extracts text data by "xlstotext" cmd from a given xls file URL.

Parameters:

  • u: a string representing the URL to extract data from.

Returns:

  • string: the extracted data.
  • int: the HTTP status code.
  • error: any error that occurred during the extraction process.

func ExtractFromURLByTika

func ExtractFromURLByTika(u string, tikaServerURL string) (string, int, error)

ExtractFromURLByTika extracts text data from a given xls file URL using the Tika server.

Parameters:

  • u (string): The xls file URL from which to extract the data.
  • tikaServerURL (string): The URL of the Tika server.

Returns:

  • string: The extracted data.
  • int: The status code of the HTTP response from the URL or Tika server.
  • error: Any error that occurred during the extraction process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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