I have problem using the BufferWriter

I have problem using the BufferWriter. I try to write the data to a *.txt file. However, I do not know how to add the data in but not over write the previous data. Can anyone help me please?
Also the productID cannot be written into the *.txt file, the type of productID is int. Don't know why this happen...
public void writeInfo()
    try{
    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("C:\\Documents and Settings\\Charles\\My Documents\\testing.txt")));
    out.write("\n");
    out.write(productID);
    out.write("  ");
    out.write(productName);
    out.write("  ");
    out.write(originalCountry);
    out.write("  ");
    out.write(Double.toString(price));
    out.write("  ");
    out.write(productCategory);
    out.write("  ");
    out.write(Double.toString(vatPrice));
    out.write("  ");
    out.write(manufacturerName);
    out.write("  ");
    out.write(manufacturerAddress);
    out.write("  ");
    out.write(warranty);
    out.flush();
    out.close();
    catch(IOException ex)
     ex.printStackTrace();
  }

Charles_Wong wrote:
Also the productID still cannot be written into the *.txt file...
and where can I find the line.separator?
Edited by: Charles_Wong on Dec 12, 2007 2:56 AMSystem.getProperty("line.separator")

Similar Messages

  • Does anyone have problems using the  highlights, shadows and sharpness edits in iphoto? Since I uploaded Mountain Lion, those editing tabs do not work!

    Does anyone have problems using the highlights, shadows and sharpness controls in iphoto 11? Since I uploaded Mountain Lion on my
    mac mini, those editing features no longer work!!!!

    Sorry, I booted into 10.8 just to test this, but I only have iPhoto 08.

  • Will i have problems using the restore option ,since i can't use the back up and sync options ?

    It gives me "itunes could not backup George Iphone because the iphone disconnected" so i can't neither sync nor back up ,and i've heard that restoring the phone might fix the problem ...

    See Here  >  http://support.apple.com/kb/HT1808
    Megadobriq wrote:
    ... i've heard that restoring the phone might fix the problem ...
    You may need to try this More than Once...  Be sure to Follow ALL the Steps...
    If necessary...  see this discussion...
    https://discussions.apple.com/message/24163508

  • Adobe Bridge shuts down when I try to access files on my external drive. Have been using the drive for months with no problems.

    Adobe Bridge shuts down when I try to access files on my external drive. Have been using the drive for several months with no problems.

    Due to the current unavailability of clairvoyants and mind-readers in the forum, we respectfully request you supply sensible, complete details.
    A lot more information about your hardware and software is needed.
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CC", but something like CC2014.v.2.2) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    a screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • I have final cut pro x-i have been using the share button previously and had no problem.as of today i share a movie to 720hd, and after a white it says share successful but i cannot find where the movie has been saved???need help

    i have final cut pro x-i have been using the share button previously and had no problem.as of today i share a movie to 720hd, and after a while it says share successful but i cannot find where the movie has been saved???need help--i cannot find the destination. can this be changed.it used to go to itunes, home video.thanks, dimitrios

    EExactly what settings are you using. Some go to iTunes.

  • I have just installed Digital Editions 4.3 but am having poblems downloading digital books as I get an error message stating 'Error! Check Activation'. I have Windows 7 and didn't have any problems using the previous version of Digital Editions. Can anyon

    I have just installed Digital Editions 4.3 but am having poblems downloading digital books as I get an error message stating 'Error! Check Activation'. I have Windows 7 and didn't have any problems using the previous version of Digital Editions. Can anyone advise?

    Hi Siobhan ,
    Please refer to the following link and see if that helps.
    https://helpx.adobe.com/digital-editions/kb/error-e_act_not_ready.html
    I would also like to know ,does that error message has any specific number ?
    Regards
    Sukrit Dhingra

  • Ever since i have started using the latest version 4,0,1, sometimes whe i press the back button it opens 7 tabs automaticcly. I have checked my regristry and tun several scanners but nothing can be found So whats the problem or were can i check??

    Ever since i have started using the latest version 4,0,1, sometimes when i press the back button it opens 7 tabs automaticcly. I have checked my registrey and run several scanners but nothing can be found So whats the problem or were can i check??

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Neither Firefox or other web browser will access the net UNLESS I use the restore feature. The next day the problem occurs again and again I have to use the restore feature? It works on my laptop so not ISP problem do I have a trojan or something?

    It seems that no browser will work. Firefox is my preferred browser but IE wont work either unless I use the restore function and then they work fine. However if I close my computer down for any reason they wont work and again I have to use the restore function. My email program works just fine (I use Agent) my ISP says there is no problem with my connection. My Firefox on my laptop works just fine and it uses the same connection as my desktop where the problem is.

    This can be a problem with the file [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    Delete [http://kb.mozillazine.org/sessionstore.js sessionstore.js] and sessionstore.bak in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder]
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.
    See:
    * http://kb.mozillazine.org/Session_Restore
    See also:
    * http://kb.mozillazine.org/Firefox_crashes
    * [[Firefox crashes]]

  • Does anyone have problems with the lightening to USB cable when charging from an outlet? After 6  months of use, it seems to wear out as a result of twisting caused by using the iPad while charging?

    Does anyone else have problems with the lightening to USB cables, particularly the longer version, when using the iPad and charging at the same time?
    If so, am I doing anything wrong?

    Not using any mouse pad, I have a very smooth desktop. But I just tried to use a sheet of A4 printing paper, but no result, the problem persisted.
    Someone on this forum suggested, that USB3 may interfere with the magic mouse.
    I have 2 LaCie HDD's about 70 cm away from the mouse, I use them on Thunderbolt. But in operation or not - the result is the same, the mouse plays up! Just now I was clicking the desktop and the mouse created a new folder!!
    Thanks for the advice, Bee
    Cheers, Gerd

  • After i have downloaded an album from iCloud to my new macbook pro. Itunes will only play one song at a time. If i hit the fast forward or back button will not do anything. I have to use the mouse to hit the next tidal in the album then hit play for it

    after i have downloaded an album from iCloud to my new macbook pro. Itunes will only play one song at a time. If i hit the fast forward or back button will not do anything. I have to use the mouse to hit the next tidal in the album then hit play for it to play the next song. Or put it in the UP NEXT.

    First, make sure these items have checkmarks next to their names in iTunes. Continuous playback only works on checked items. Itunes will play all checked items in a list whether or not they're from the same album.
    If you see that nothing in your library is checked and you want to check everything, hold down Ctrl while checking an item. This checks everything.
    Next, fixing the "1 of 1" problem is easily. Select all the tracks that make up the book/album. Let's say there are 15. Press Ctrl-I. Doublecheck that the album box is filled in with the name of the book, and if not, type it there. Enter "15" in the box for the total number of tracks. Click OK. Now all the items should be "1 of 15," "2 of 15," and so on.

  • When my screen saver has been on a while, I have to use the cursor to "rub out" part of the screen saver to see my login section. Can anyone help me with this?

    When my screen saver has been on a while, I have to use the cursor to "rub out" part of the screen saver to see my login section. Can anyone help me with this?

    I don't have a solution for you, but just wanted to let you know I used to have the exact same problem. I resolved it (for the most part....about 90% of the time, anyway) by adjusting the screensaver and power settings to never let the computer go to sleep.

  • Could not complete the command because of a problem using the Adobe Color Engine

    Hi all
    This bizarrely started this morning - completely out of the blue - and I've no idea why.
    Setup: Mac 10.8.2 / Creative Suite Premium PhotoShop CS5 extended (patched to 12.04)
    Am working on images exported from LightRoom 4 (16bit A3 Pro Photo RGB PSDs) in PhotoShop CS5.
    As part of my image grading process I have a PhotoShop Action that does the following: copy layer to new document (document respects all of copied layer settings) > Image > Adjustments > HDR toning > apply a certain HDR preset > copy to resultant image back to original doc > set opacity as 40%.
    Totally out of the blue, after having this action for about 2 months, this morning I start getting a warning dialog of "Could not complete the command because of a problem using the Adobe Color Engine" and the action fails. The failure seems to take place at the 'make document' part of the action and seems to somehow be related to the contents of the clipboard.
    I've tried trashing and re-creating the action. It works first time out fine and then - on the next image - errors again.
    At present I can only safely carry out the work 'manually' by completing all the actions myself.
    I can think of no settings that have changed and the OS hasn't been updated in a while.
    I have found one other thread on a similar problem in PhotoShop Elements, but no definitive solution.
    Any help appreciated as I have a shedload of stuff to process.
    Best wishes
    TP

    OK: trash of prefs didn't work. Tried thrice. Re-created orig action. same problem.
    BUT!
    Your 'Image > Duplicate' suggestion does seem to work. If I use that in a new action as the method for creating the HDR version doc (instead of 'Select > Copy > New > Paste), it seems to work.
    Will try that out this afternoon, but for now: WIN!
    Many thanks for the suggestion!
    TP

  • I can't read Or write I have been using the iPad With the accessibility icon Is there a video help them teach me how to use it more efficiently

    I cannot read or write I have been using the iPad With the accessibility icon  Is there a video to help teach me To learn how to use this accessibility more efficiently

    It sounds like you may have multiple problems, but none of them are likely to be caused by malware.
    First, the internet-related issues may be related to adware or a network compromise. I tend to lean more towards the latter, based on your description of the problem. See:
    http://www.adwaremedic.com/kb/baddns.php
    http://www.adwaremedic.com/kb/hackedrouter.php
    If investigation shows that this is not a network-specific issue, then it's probably adware. See my Adware Removal Guide for help finding and removing it. Note that you mention AdBlock as if it should have prevented this, but it's important to understand that ad blockers do not protect you against adware in any way. Neither would any kind of anti-virus software, which often doesn't detect adware.
    As for the other issues, it sounds like you've got some serious corruption. I would be inclined to say it sounds like a failing drive, except it sounds like you just got it replaced. How did you get all your files back after the new drive was installed?
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • I have been using the Firefox feature in which I could have multiple sets of tabs open but see only the set I was working with. I updated and now feature is gon

    I have been using the Firefox feature in which I could have multiple sets of tabs open but see only the set I was working with. I updated and now feature is gone. I had a small icon on the upper right side of my toolbar. I used it all the time to keep separate windows for news, financial items, travel plans, etc. Has this been removed from Firefox?

    Hi,
    The [https://support.mozilla.org/en-US/kb/tab-groups-organize-tabs Tab Groups] feature is still present. You can try to right-click the + after the last tab and [https://support.mozilla.org/en-US/kb/how-do-i-customize-toolbars Customize]. If the icon is hidden behind another, or if it's available inside the Customize mini window, you can place it back. If the problem persists, you can also try to '''Reset toolbars and controls:''' and '''Make Changes and Restart''' [https://support.mozilla.org/en-US/kb/Safe%20Mode Safe Mode] start screen.

  • Problem using the Write to SGL VI and Read from SGL VI

    Hello Sir, I have a problem using the Write to SGL VI. When I am trying to write the captured data using DAQ board to a SGL file, I am unable to store the data as desired. There might be some problem with the VI which I am using to write the data to SGL file. I am not able to figure out the minor problem I am facing. I am attaching a zip file which contains five files.
    1) Acquire_Current_Binary_Exp.vi -> This is the VI which I used to store my data using Write to SGL file.
    2) Retrive_BINARY_Data.vi -> This is the VI which I used to Read from SGL file and plot it
    3) Binary_Capture -> This is the captured data using (1) which can be plotted using (2) and what I observed is the plot is different and also the time scare is not as expected.
    4) Unexpected_Graph.png is the unexpected graph when I am using Write to SGL and Read from SGL to store and retrieve the data.
    5) Expected_Graph.png -> This is the expected data format I supposed to get. I have obtained this plot when I have used write to LVM and read from LVM file to store and retrieve the data.
    I tried a lot modifying the sub VI’s but it doesn’t work for me. What I think is I am doing some mistake while I am writing the data to SGL and Reading the data from SGL. Also, I don’t know the reason why my graph is not like (5) rather I am getting something like its in (4). Its totally different. You can also observe the difference between the time scale of (4) and (5).
    Have a Good Day
    Regards,
    Krishna
    Attachments:
    LABVIEW_Files.zip ‏552 KB

    As already discussed a while ago, your binary data does not contain timing information. You need to tell it the scan rate so it can reconstruct the time axis correcty.
    From the data, it seems the sample file was recorded at 0.5MHz. Take the inverse and set the time increment. Voila!
    Your sample file is two column data with one colum all zero. You need to set the number of columns to two, to only get the good data in channel 1.
    Your acquisition program contains unecessary FOR loops, you can remove the inner loops without change in result.
    It makes no sense to convert to SGL if you initialize the shift registers with an empty DBL array. You need to initialize with an empty SGL array.
    (The code could be simplified quite a bit more, but this should give you some directions).
    The attached zip shows some ideas (LabVIEW 7.1).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    LabVIEW_FilesMOD.zip ‏195 KB

Maybe you are looking for

  • How to call smartform FM after using SSF_FUNCTION_MODULE_NAME?

    Hi Experts, How to call smartform FM after using SSF_FUNCTION_MODULE_NAME? I mean, in driver program i called SSF_FUNCTION_MODULE_NAME to get the related FM  for my smart form. after that How do I call it(smartform fm) . I tried to call by pressing P

  • Please help....Magazine prints are too dark!

    Hey guys, If I'm honest, I'd say I've just about gotton by with my knowledge colour management (just started getting into reading Real worl color management), and have been cruising my way around Photoshop for several years now. I've been mostly very

  • Using AIR for desktop

    is drag'n'drop from system and back possible? i would like to build an air desktop drop zone area. it would be cool when i can use flex for building desktop gadgets. last time i checked it was not possible to drop content to air at all. hence a cs4 f

  • Itunes repeatedly crashes when it starts up

    I even updated but it still crashes seconds after it starts up. It gives me the error: Process:         iTunes [146] Path:            /Applications/iTunes.app/Contents/MacOS/iTunes Identifier:      com.apple.iTunes Version:         10.3.1 (10.3.1) Bu

  • Mac Notes won't connect to iCloud; system preferences crash despite fixes tried

    I am on 10.8.5, have not updated to Mavericks yet. My Mac for notes doesn't want to connect to iCloud so that my notes will sync between all devices. I have tried all of the solutions that seemed to work for others, like deleting cache, rebooting, ma