pop

command module
v0.0.0-...-7da7232 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2018 License: MIT Imports: 10 Imported by: 0

README

Pop

StackOverflow answers in your terminal.

Usage

$ pop open file java

Read file, parse each line into an integer and store into a list:

List<Integer> list = new ArrayList<Integer>();
File file = new File("file.txt");
BufferedReader reader = null;

try {
    reader = new BufferedReader(new FileReader(file));
    String text = null;

    while ((text = reader.readLine()) != null) {
        list.add(Integer.parseInt(text));
    }
} catch (FileNotFoundException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
} finally {
    try {
        if (reader != null) {
            reader.close();
        }
    } catch (IOException e) {
    }
}

//print out the list
System.out.println(list);


Url: http://stackoverflow.com/questions/3806062/how-to-open-a-txt-file-and-read-numbers-in-java

Install

go get github.com/alexrs/pop

TODO

  • Parse the HTML better and display it properly
  • Tests
  • More options (contribute or suggest new features!)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL