Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.logging.Filter;
- public class Main {
- public static void main(String[] args) throws IOException{
- InputStream in = new FileInputStream("izvor.txt");
- BufferedInputStream bis = new BufferedInputStream(in);
- OutputStream out = new FileOutputStream("destinacija.txt");
- BufferedOutputStream bos = new BufferedOutputStream(out);
- BufferedReader bf = new BufferedReader(new InputStreamReader(bis));
- while(bf.ready()) {
- String s = bf.readLine();
- if(s.charAt(0) >= '0' && s.charAt(0) <= '9') {
- bos.write(s.getBytes());
- bos.write(10);
- }
- }
- bos.flush();
- bis.close();
- bos.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement