func (reader *Reader) SetDefault() {
	if strings.TrimSpace(reader.Rejected) == "" {
		reader.Rejected = DefaultRejected
	}
	if reader.MaxRows == 0 {
		reader.MaxRows = DefaultMaxRows
	}
	if strings.TrimSpace(reader.DatasetMode) == "" {
		reader.DatasetMode = DefDatasetMode
	}
	if reader.dataset == nil {
		reader.dataset = &tabula.Dataset{}
	}
}
SetDefault options for global config and each metadata.
package dsv
import (
	"bufio"
	"log"
	"os"
	"strings"
	"github.com/shuLhan/share/lib/tabula"
)
const (
	DatasetModeROWS = "ROWS"
	DatasetModeCOLUMNS = "COLUMNS"
	DatasetModeMATRIX = "MATRIX"
)
type Reader struct {
	Config
	dataset interface{}
	Input string `json:"Input"`
	Skip int `json:"Skip"`
	TrimSpace bool `json:"TrimSpace"`
	Rejected string `json:"Rejected"`
	InputMetadata []Metadata `json:"InputMetadata"`
	MaxRows int `json:"MaxRows"`
	DatasetMode string `json:"DatasetMode"`
	fRead *os.File
	fReject *os.File
	bufRead *bufio.Reader
	bufReject *bufio.Writer
}
func NewReader(config string, dataset interface{}) (reader *Reader, e error) {
	reader = &Reader{
		Input:         "",
		Skip:          0,
		TrimSpace:     true,
		Rejected:      DefaultRejected,
		InputMetadata: nil,
		MaxRows:       DefaultMaxRows,
		DatasetMode:   DefDatasetMode,
		dataset:       dataset,
		fRead:         nil,
		fReject:       nil,
		bufRead:       nil,
		bufReject:     nil,
	}
	e = reader.Init(config, dataset)
	if e != nil {
		return nil, e
	}
	return
}
func (reader *Reader) Init(fcfg string, dataset interface{}) (e error) {
	if dataset == nil {
		dataset = reader.GetDataset()
		if dataset == nil {
			dataset = &tabula.Dataset{}
			reader.dataset = dataset
		}
	}
	fcfg = strings.TrimSpace(fcfg)
	if fcfg != "" {
		e = ConfigOpen(reader, fcfg)
		if e != nil {
			return e
		}
		e = tabula.ReadDatasetConfig(dataset, fcfg)
		if e != nil {
			return e
		}
	}
	reader.SetDefault()
	reader.SetDatasetMode(reader.GetDatasetMode())
	ds := dataset.(tabula.DatasetInterface)
	md := reader.GetInputMetadata()
	for i := range md {
		md[i].Init()
		if !md[i].GetSkip() {
			col := tabula.Column{
				Type:       md[i].GetType(),
				Name:       md[i].GetName(),
				ValueSpace: md[i].GetValueSpace(),
			}
			ds.PushColumn(col)
		}
	}
	reader.SetInput(ConfigCheckPath(reader, reader.GetInput()))
	reader.SetRejected(ConfigCheckPath(reader, reader.GetRejected()))
	e = reader.OpenRejected()
	if nil != e {
		return e
	}
	return reader.OpenInput()
}