Skip to content

An easy way to iterate over the lines of a file in Java.

License

Notifications You must be signed in to change notification settings

safetytrick/FileIterator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileIterator

An easy way to iterate over the lines of a file in Java.

You can use it just like any other Iterable in java. For example:

FileIterable fileIterable = FileIterable.openFile(file);
try {
    for (String line : fileIterable) {
        System.out.println(line);
    }
} finally {
    fileIterable.close();
}

You can also index a specific line. Like this:

FileIterable fileIterable = FileIterable.openFile(file); String line = fileIterable.get(10); System.out.println(line);

TODO

I still want to add a few more options I often wish I had easy access to in Java. Such as:

  • grep and other find methods.
  • set and replace.

About

An easy way to iterate over the lines of a file in Java.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%