processing

package
v0.0.61 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceLineTerminator added in v0.0.40

func ReplaceLineTerminator(data, newLineTerminator []byte) ([]byte, error)

ReplaceLineTerminator is delegated to find the line terminator of the given byte array and replace them without the one provided in input

func ReplaceLineTerminatorBytesReader added in v0.0.41

func ReplaceLineTerminatorBytesReader(data *bytes.Reader, newLineTerminator []byte) ([]byte, error)

ReplaceLineTerminator is delegated to find the line terminator of the given byte array and replace them without the one provided in input

Types

type LineTerminatorType

type LineTerminatorType string
const (
	LF   LineTerminatorType = "\n"   // 0a -- 10
	CR   LineTerminatorType = "\r"   // 0d -- 13
	CRLF LineTerminatorType = "\r\n" // 0d,0a -- 13,10
	LFCR LineTerminatorType = "\n\r" // 0a,0d -- 10,13
	RS   LineTerminatorType = "\036" // 1e -- 30
	ND   LineTerminatorType = `unable to detect line terminator`
)

func DetectLineTerminator

func DetectLineTerminator(reader io.Reader) (LineTerminatorType, error)

FIXME: Select the line terminator by reading all the file and finding the one that occurs more time

Jump to

Keyboard shortcuts

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