Updating text file in java

22-Jul-2019 17:09

Read the whole file into a string array, make the changes, write the file back out. pls find below the format COD-Type:image/gif COD-Size:26241 COD-URL: ft COD-Name:welcome ft eg.

For bigger files, you'll need an in stream and an out stream. image/gif need to be changed as image/jpeg Pls give me an example.

Hmmm okay i see maybe i was wrong : P but i find the scanner method so much quicker and simpler to read files... maybe my misconception came from back in the day when i was a REAL n OOb now im a semi n OOb lol Lol :)...

and yes i could have used an array list but the main reason was it would have changed the whole method i used to find and replace certain text.

Now my problem is how do i save the corrected value to my text file.

For example,my text File has 23;1; North ;100 22;3; South;200 21;4; East;600 20;5; Weet;900 My fourth list has wrongly spelled name.

I know the problem is lines.length() is static (doesn't increase).

I want solution, how to make my 2nd sketch (js) reading data continually. My project is log data from xbee usb adapter and share it via browser..

/* The below is another way in which to read the file, however i think the shorter method would be the scanner class The reason for this is the below commented method uses 5 extra imports: import This of course if mitigated by using an IDE but is a good thing to know just in case. The imports are anyways used to manage compile time dependencies.

This save button will call a method in Action Class.

I dont know what should i do in that action class to save the corrected value to the text file.

get Resource As Stream("DB.txt"); Buffered Reader reader = new Buffered Reader(new Input Stream Reader(in Stream)); String line = null; while((line = Line())!

=null) String Number = Token(); String Id = Token(); String name = Token(); String rate = Token(); Collect collect = new Collect(lane Id,origin,destination,mode,rate Type,rate,ibu); List.add(lane); here collect is a java class with getter and setter methods.

Any hit or clue or any help will be really appreciated.