Comma-Separated Value (CSV) file, it’s likely that applications like Excel export spreadsheets into CSV file or a custom application program encode it data into CSV format for you. I assumed you getting in UTF-8 encoded. Instead of hard coding the filenames into the source code, filename will pass into the progam as parameters (arguments) Public… Continue reading Read a CSV file
Category: Standard Library
Search the Go Package with this URL https://pkg.go.dev/
Read a File with io/ioutil
https://golang.org/pkg/io/ioutil/#example_ReadFile
Regular Expression
regrex package https://golang.org/pkg/regexp/ On-line Regular Expression https://regex101.com/ Meta Characters Metacharacters are characters that are interpreted in a special way by a RegEx engine. Here’s a list of metacharacters: [] . ^ $ * + ? {} () \ | [] – Square brackets Square brackets specifies a set of characters you wish to match. . – Period A period matches any single character (except newline ‘\n’). – Caret The caret… Continue reading Regular Expression
https://golang.org/pkg/strings/
func Split func Split(s, sep string) []string Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators. If s does not contain sep and sep is not empty, Split returns a slice of length 1 whose only element is s. If sep is empty, Split splits after… Continue reading https://golang.org/pkg/strings/
SHA265 – cypto/sha256
Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4. https://golang.org/pkg/crypto/sha256/
os package Reading from the opened file.
Read method, one take []byte slice argument. Return two values namely n int type and err error type. In this example, an assumption that the file already opens with os.Open(). a make initializes the variable on a slice of []byte type with has a quantity of 100 of memory of bytes size (uint8 – unsigned… Continue reading os package Reading from the opened file.
os package with reading an open file and error log
the os package import a few other packages. file, err := os.Open(“file.go”) // For read access. if err != nil { log.Fatal(err) } Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it… Continue reading os package with reading an open file and error log
Reader
Writer and Flush
What is a buffer?
Send data to a buffer (system memory) and will not write until it reaches the length. After which it writes the data and flushes the buffer.