Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var names []string
- scanner := bufio.NewScanner(file)
- for scanner.Scan() {
- name := scanner.Text()
- for i := 0; i < 4; i++ {
- names = append(names, name)
- }
- }
- newFile, _ := os.Create("new_names.csv")
- defer newFile.Close()
- writer := bufio.NewWriter(newFile)
- for _, name := range names {
- _, _ = writer.WriteString(name + "\n")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement