Because this is invalid csv.
Should be:
This\t"""is"" no"\tfun

If you still need to parse it, then write your own parser that handles it, 
for instance using a bufio.Reader.

Le jeudi 28 septembre 2017 22:56:27 UTC+2, Lantos István a écrit :
>
>
> I want to parse the following CSV structure. The column separators are 
> tabs:
>
> *package main*
>
> *import (*
> *    "encoding/csv"*
> *    "fmt"*
> *    "log"*
> *    "strings"*
> *)*
>
> *func main() {*
> *    in := `This    "is" not    fun`*
> *    r := csv.NewReader(strings.NewReader(in))*
> *    r.Comma = '\t'*
>
> *    records, err := r.ReadAll()*
> *    if err != nil {*
> *        log.Fatal(err)*
> *    }*
>
> *    fmt.Print(records)*
> *}*
>
> Google Playground <https://play.golang.org/p/ZZ5t-lvfaK>
>
> There is a tab after *This* and before *fun*. Between *"is"* and* not* 
> there is only a space. This should be one column. I  setted the column 
> separator with* r.Comma ="\t"*, but for some reason I'm getting the 
> following error:
>
> *line 1, column 8: extraneous " in field*
>
> Is there a way to achieve what I want?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to