Skip to content

alexrs/pop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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!)

About

StackOverflow answers in your terminal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages