Java Text File Read Line readLines2Lowcase(String inputFile, ArrayList lines)

Here you can find the source of readLines2Lowcase(String inputFile, ArrayList lines)

Description

read Lines Lowcase

License

Apache License

Declaration

public static void readLines2Lowcase(String inputFile, ArrayList<String> lines) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.*;

import java.io.*;

public class Main {
    public static void readLines2Lowcase(String inputFile, ArrayList<String> lines) {
        BufferedReader reader = null;

        try {/*w w  w. j a v  a  2  s .c  o  m*/

            reader = new BufferedReader(new FileReader(new File(inputFile)));

            String line = null;
            while ((line = reader.readLine()) != null) {
                lines.add(line.toLowerCase());
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}

Related

  1. readLines(String lines)
  2. readLines(String string)
  3. readLines(String targetPath)
  4. readLines(String text)
  5. readLines(String text)
  6. readLinesAsList(String filename)
  7. readLinesFileSimple(final File inFile, final int prefixMode, final String prefix)
  8. readLinesFromCommand(String command[], List buffer)
  9. readLinesNoComments(String fileName)