problem with Text files format
Hello,
thanks once more for your help at my previous thread, "Vector Problems...".
Well the assignment has moved on and now it's the time to write some data in files.
I am using the following code:
bw.write("{");
bw.write("\n\tComponents");
bw.write("\t{\n");
for (int i=indexes[0];i<indexes[1];i++)
{
bw.write("\t\tMotherboard"+"\n");
bw.write("price = "+Float.toString(components.elementAt(i).getPrice())+"\n");
}
bw.close();
and the requested output file format should be:
{
Components
{
Motherboard
{
price = 10
...
(Corresponding to the code above, normally there are other fields than "price", but the logic is the same I guess).
Unfortunately, the output text file is something like:
{Components{Motherboard{price = 10
So the "\n" characters are ignored, but the "\t" chars aren't ignored.
Any help would be greatly appreciated.
philimon>

