How to append 4 digit number to the next string read from file
I have one file to read which is like this
mytxt.txt
1234 http://www.abc.com
8754 http://www.xyz.com
I tried with this
try {
// make a 'file' object
File file = new File("e:/mytxt.txt");
// Get data from this file using a file reader.
FileReader fr = new FileReader(file);
// To store the contents read via File Reader
BufferedReader br = new BufferedReader(fr);
// Read br and store a line in 'data', print data
String data;
while((data = br.readLine()) != null)
{
//data = br.readLine( );
System.out.println(data);
}
} catch(IOException e) {
System.out.println("bad !");
}
I used this but the actual question is I want to read one this two
charachter one by one and then appens the digit to the link which I'll
read as string. Can anyone tell me how I am suppose to do that..? any help
would be appreciated.
No comments:
Post a Comment