File System
Hello folks,
I am writing an application in which I need to write into a file some information like:
Master file Account numberName Balance
100 Alan Jones 348.17
300 Mary Smith 27.19
500 Sam Sharp 0.00
One row for each record, again when an user require to access his accounts he may enter his account number and the related records will be fetch, thats why I want to insert each record with the help of row and column.
Here is my code for to write into a file.:
import java.io.*;
class ProgramTest
{
int a_num;
int t_amt;
publicstaticvoid main(String[] a)throws IOException
{
ProgramTest object =new ProgramTest();
BufferedWriter out=null;
try
{
File file =new File("oldmast.txt");
File file1 =new File("trans.txt");
// Create file if it does not exist
if (file.createNewFile())
{
// File did not exist and was created
System.out.println("oldmast.txt Created Successfully");
}
else
{
System.out.println("oldmast.txt already exists");
}
if (file1.createNewFile())
{
// File did not exist and was created
System.out.println("trans.txt Created Successfully");
}
else
{
System.out.println("trans.txt already exists");
}
TransactionRecord obj=new TransactionRecord();
object=obj.retrieve(object);
out =new BufferedWriter(new FileWriter("oldmast.txt",true));
out.write(String.valueOf(object.a_num));
out.write(String.valueOf(object.t_amt));
}
catch (IOException e)
{
}
finally
{
out.close();
}
}
}
What will I do to use the rows and columns kind of format, please help me out, I am relatively new in the java file system.
please help!
Thanking you all friends.

