Skip to content

asimlqt/csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

csv

This is a copy of the standard go csv writer with only one change. A callback function has been added to the Writer so users can decide whether a field should be quoted or not.

Usage

go get github.com/asimlqt/csv

The callback takes 2 arguments, n is the index of the field starting at zero and field is the actual value that is to be output. The following example will add quotes around the first column in the csv.

writer := csv.NewWriter(file)
writer.NeedsQuotes = func(n int, field string) bool {
	if n == 0 {
		return true
	}
	return false
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages