Skip to content

Instantly share code, notes, and snippets.

@cipepser
Created Aug 6, 2017
Embed
What would you like to do?
package main
import (
"bufio"
"fmt"
"io"
"os"
"strings"
)
func main() {
f, err := os.Open("../data/q50_out.txt")
defer f.Close()
if err != nil {
panic(err)
}
r := bufio.NewReader(f)
for {
s, _, err := r.ReadLine()
if err == io.EOF {
break
}
for _, w := range strings.Split(string(s), " ") {
fmt.Println(w)
}
fmt.Println("")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment