Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void filtrujZmrz(String filtr){
- FileReader fr = null;
- try{
- fr = new FileReader("objednavky_stat.txt");
- BufferedReader in = new BufferedReader(fr);
- String radek;
- LinkedList<String> vysledek = new LinkedList<String>();
- while((radek = in.readLine())!=null){
- if(radek.contains(": "+filtr)){
- vysledek.add(radek);
- }
- }
- for(int i=0;i<vysledek.size();i++){
- System.out.println(vysledek.get(i));
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- finally{
- if ( fr != null ) {
- try {
- fr.close();
- }
- catch ( IOException ioe ) {
- ioe.printStackTrace();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment