mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 10:15:36 +00:00
preliminary CR/LF handling, pending port of autodetect
This commit is contained in:
parent
c59913f9fd
commit
dee599ec5b
4 changed files with 17 additions and 0 deletions
|
|
@ -146,6 +146,9 @@ func (this *RecordReaderCSVLite) processHandleExplicitCSVHeader(
|
|||
// This is how to do a chomp:
|
||||
line = strings.TrimRight(line, this.irs)
|
||||
|
||||
// xxx temp pending autodetect, and pending more windows-port work
|
||||
line = strings.TrimRight(line, "\r\n")
|
||||
|
||||
if line == "" {
|
||||
// Reset to new schema
|
||||
headerStrings = nil
|
||||
|
|
@ -237,6 +240,9 @@ func (this *RecordReaderCSVLite) processHandleImplicitCSVHeader(
|
|||
// This is how to do a chomp:
|
||||
line = strings.TrimRight(line, this.irs)
|
||||
|
||||
// xxx temp pending autodetect, and pending more windows-port work
|
||||
line = strings.TrimRight(line, "\r\n")
|
||||
|
||||
if line == "" {
|
||||
// Reset to new schema
|
||||
headerStrings = nil
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ func (this *RecordReaderDKVP) processHandle(
|
|||
} else {
|
||||
// This is how to do a chomp:
|
||||
line = strings.TrimRight(line, "\n")
|
||||
|
||||
// xxx temp pending autodetect, and pending more windows-port work
|
||||
line = strings.TrimRight(line, "\r\n")
|
||||
|
||||
record := recordFromDKVPLine(&line, &this.ifs, &this.ips)
|
||||
context.UpdateForInputRecord()
|
||||
inputChannel <- types.NewRecordAndContext(
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@ func (this *RecordReaderNIDX) processHandle(
|
|||
} else {
|
||||
// This is how to do a chomp:
|
||||
line = strings.TrimRight(line, "\n")
|
||||
|
||||
// xxx temp pending autodetect, and pending more windows-port work
|
||||
line = strings.TrimRight(line, "\r\n")
|
||||
|
||||
record := recordFromNIDXLine(&line, &this.ifs)
|
||||
|
||||
context.UpdateForInputRecord()
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@ func (this *RecordReaderXTAB) processHandle(
|
|||
// This is how to do a chomp:
|
||||
line = strings.TrimRight(line, this.irs)
|
||||
|
||||
// xxx temp pending autodetect, and pending more windows-port work
|
||||
line = strings.TrimRight(line, "\r\n")
|
||||
|
||||
if line == "" {
|
||||
if linesForRecord.Len() > 0 {
|
||||
record, err := this.recordFromXTABLines(linesForRecord)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue