拉莫斯之舞
这样的事情应该可以解决问题:package mainimport ( "encoding/csv" "fmt" "io" "io/ioutil" "log" "os" "strings")func main() { file, err := os.Open("in.csv") if err != nil { log.Fatal(err) } r := csv.NewReader(file) fileIndex := 1 for { record, err := r.Read() if err == io.EOF { break } err := ioutil.WriteFile( fmt.Sprintf("Test%d.txt", fileIndex), strings.Join(record, " "), 0755, ) if err != nil { log.Fatal(err) } fileIndex++ }}