Skip to content

Instantly share code, notes, and snippets.

@cipepser
Created August 6, 2017 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cipepser/154c531bd00e06627a06871620015ece to your computer and use it in GitHub Desktop.
Save cipepser/154c531bd00e06627a06871620015ece to your computer and use it in GitHub Desktop.
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