প্রথমে টেক্সট ফাইল থেকে ইনপুট নিবো । এরপর ইনপুট নেওয়া স্ট্রিঙের উপর কিছু অপারেশন করবো । সর্বশেষ, আপডেটেড স্ট্রিং আরেকটি ফাইলে লিখবো । ইনপুট ফাইলে বাংলা, ইংলিশসহ যেকোনো ভাষার শব্দই থাকতে পারে । আমি এটা কীভাবে করতে পারি?

BufferedReader read = new BufferedReader(new InputStreamReader(new FileInputStream("Input1.txt"), StandardCharsets.UTF_8));
Writer  writeFirst = new BufferedWriter(new OutputStreamWriter(new  FileOutputStream("Input.txt",true),StandardCharsets.UTF_16));
String str = null;
while (( str = read.readLine()) != null) {
    String[] words = str.split(" ");
    //do some task
    for(String s : words)
        writeFIrst.write(s);
}

asked 12 Jul, 07:40

sshuvo's gravatar image

sshuvo
1549

edited 13 Jul, 16:01

Mosharraf%20Hosain's gravatar image

Mosharraf Hosain ♦
48618

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×208

question asked: 12 Jul, 07:40

question was seen: 91 times

last updated: 13 Jul, 16:01