473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

append issue

momotaro
357 100+
I've created this method to append strings but it throws
an exception when I try to use it:

fdf.append(orm);

orm is a string.

Expand|Select|Wrap|Line Numbers
  1. public void append(String text)
  2.     {
  3.  
  4.         try{
  5.             fstream = new FileWriter(file);
  6.             BufferedWriter file = new BufferedWriter(fstream);
  7.             file.append(text);
  8.             file.close();
  9.         }
  10.         catch (Exception e) {
  11.             System.err.println("Error: can't append");
  12.         }
  13.     }
Jul 29 '11 #1
1 1561
Dheeraj Joshi
1,123 Expert 1GB
Do you have the stack trace of the exception?

I think your constructor for file stream should have one more argument.

Expand|Select|Wrap|Line Numbers
  1. fstream = new FileWriter(file,true); --> True is for append
  2.  
Regards
Dheeraj Joshi
Aug 1 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Rose | last post by:
I have an access 2000 database. In it I have a table OPEN Items which has a field Issue that is setup as a MEMO field. I am trying to append information from another table with the same setup,...
2
by: Arvind R | last post by:
Hello, how to ask saveas dialog before writing the data to the excel file? right now im able to save in c drive or any other specified location only. any solution will be a great help! ...
1
by: AlekseyUS | last post by:
Hi, I'm a little stuck, I basically need to copy all the information within a specific file in Temp and append it to a file in another location. I'm not having any problems with smaller size...
2
by: gokhvat | last post by:
I am experiencing a strange cross-platform issue with my python program. I am using wxRadioBox to create radio buttons. When I run the python code on a mac, everything works perfectly, but not...
0
by: Mangler | last post by:
I have a SQL stored proc that returns a result of yes if the a record exsists. In turn there is a command that calls the proc and passes variables when a user inserts data. If the result is yes...
1
by: Simon Gare | last post by:
Hi all, have a line of code in a ViewLocation.aspx.cs file below StringBuilder sb = new StringBuilder(); sb.Append("Driver No: ").Append(driver.DriverNo.ToString()).Append("<br>");...
1
by: Simon Gare | last post by:
Hi all, have a line of code in a ViewLocation.aspx.cs file below StringBuilder sb = new StringBuilder(); sb.Append("Driver No: ").Append(driver.DriverNo.ToString()).Append("<br>");...
11
by: alf | last post by:
two ways of achieving the same effect l+= or l.append(n)
16
by: Hans Fredrik Nordhaug | last post by:
I'm trying to write to a file in the current directory - no remote files. The subject says it all - I can add that both the directory and the file is wordwritable. This happens on a (quite good)...
1
by: HarishAdea | last post by:
Hi, I am trying to run the JAVA pgm, but it is giving error as "selection does not contain a main type". The filename is "ScoreLeadSummary.java" when i try to run it or debug,it gives the pop...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.