Why is input  not copied to output?

Could some one tell me why my code below is not sllowing me to copy my in text file to my out text file. I know for a fact that I am reading the input file because when System.out.println was used within the catch block, I was able to print all data.
// User input the name of the file to copy and the file
          // to transfer the data to.          
          Scanner s = new Scanner(System.in);
          System.out.println("What is the name of the input file?");
          String input = s.next();          
          System.out.println("What is the name of the output file?");
          String output = s.next();
          //Create file names.
          File inputFile = new File("c:\\" + input + "." + "txt");
     File outputFile = new File("c:\\" + output + "." + "txt");
     //Creates BufferedReader and BufferedWriter.     
     BufferedReader in = new BufferedReader(new FileReader(inputFile));
     BufferedWriter out = new BufferedWriter(new FileWriter(outputFile));                
     //Enclose in a try ...catch because of possible exception.
     String line = null;
     try
          while((line = in.readLine()) != null)          
out.write(line);
          out.newLine();
          catch(IOException e)
               System.out.print("error");
          }

You aren't closing the output file. But I missed the part of your question which was relevant to the topic of this forum, namely Reflection.

Similar Messages

  • Why can I not copy paste anymore in Dreamweaver CC?

    Help! Why can I not copy paste anymore in Dreamweaver CC? It was working fine a week ago, did not install or delete anything in this time, the options from the pull down menu are ghosted, ctrl+c ctrl+v doesnt work. I could use paste special from the pull down menu and did.  Paste special worked once, now is ghosted too.

    Try renaming the Configuration folder to Configuration-backup.
    The folder can be found as in http://www.dmxzone.com/go/16740/clearing-dreamweaver-s-cache/

  • Why does iphoto not copy all photos when transfering

    Hi peeps.
    why does iPhoto not copy all photos from an event when im copy/pasting to an external folder on my mac(for later transfer). All softwares are up to date and ive only just realised it happens, but when i copy all pics in an event then paste in a folder, the pic count is substantially different. for example i select all pictures in an event called 'new1', the count of files is 188. i then copy/ paste to a folder,  select all files and check 'info' and it says 141 files??? 
    all i can see painstakingly going through to compare which images are in each place is that the ones that arent in my new folder , seem to be the ones ive edited in iPhoto??  conincidence? or am I missing something fundamental here?  Ive only just realised this is occuring. The trouble is, after moving images to folders/hard drives I  subsequently delete them from iphoto to keep my macbook airs HDD with some space.  So basically all of the versions of pictures I want, i.e, the new edited and adjusted versions are no longer! NOT HANDY!
      help please.

    We've seen a few reports of this in the past while and no one is sure of the cause.
    Use the File -> Export command. See this User Tip
    https://discussions.apple.com/docs/DOC-4921
    for details of the options the Export Dialogue offers.
    If you're interested in your Photos then this workflow
    The trouble is, after moving images to folders/hard drives I  subsequently delete them from iphoto to keep my macbook airs HDD with some space.
    means you are losing quality, metadata and the version of control. If you don't want these why use iPhoto at all?
    You could just move the whole Library to an external:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD

  • Why do we not get logging output for the clients?

    Q: Why do we not get logging output like #show log all | include <client mac address> for the wireless clients?
    A: When the clients connected to Bridge mode SSID, Firewall hits and logging does not work.  
    This is one of the limitations with bridge mode.  

    logical. fair. I can understand the confusion in policy  as another fine cloud service - DropBox - has a different model for increases in free storage amounts for one account = evangelism. As many policies as there are services probably.
    cya 'round o' kilted one
    CCC

  • Why can I not copy text from a file and paste into "File Name" when saving?

    I thought I used to do this but I cannot copy a string of text from within AI (CS5, CS6 or CC) then "save as" and paste into the "file name" field. Why would this be?
    This proceedure works fine in Photoshop.
    Mac OSX 10.7.5.

    I am copying the characters not the object. Something seems to have changed at the system level. I can paste the text to other applications (Skype, Word, etc.) but not the "Save" dialog. I have been pasting the text to a Skype message window and re-copying. Then it will paste into the save dialog. Weird.
    I see you are on 10.6.8. Maybe it's a system difference.

  • Why can I not copy a library to a HD? It's around 18GB and seems to stop around 126mb with a error message -36?

    The library is currently on my MacBook Pro and I've even tried connecting it through a Firewire cable and using the PB as an external HD, but I'm not allowed to move it to my iMac? Why? Help...

    Hi guys,
    Thanks Kirby for giving me the lead that it wasn't an Aperture problem per se.. You were right.
    Well I actually found two ways around the problem:
    I connect the iMac as an external HD and made a backup Vault directly on it. Then I succesfully restored the project after I disconnected the iMac and the library now works fine.
    But still being annoyed by the cause, I then generated thumbnails in the project and found four files that looked 'funky'. After I deleted those from the original library on my MacBook Pro, I could copy the library without problems to any drive.
    Hope someone else might find this helpful, but thanks again Kirby for your reply, which was correct.
    There sure was a corrupt bunch of files.

  • When attaching my iPod classic to my PC, why does it not copy the latest Playlists that I have Created??

    Why does my iPod Classic  not Sync or install the latest added Play List that I have added to (such as Jazz or Easy Listening etc.) It only copies songs that I have added in the Original Play List ???
    Can anyone out there HELP???

    '''Ya I also have the same problem. its working on I Explorer but I don't want to be so slow. '''
    plzz suggest me a solution.
    thanks.

  • HT201272 Why can i not copy(my already purchased music) over to my iphone? It says i dont have room when i looking at 8.3 gigs of free space!!!!!!!

    itunes is showing my iphone(4s) has 1.4 days of music that does not show up on phone purchasaed playlist. How can i get this music back on my phone or play it if it actually exist on my phone. Very frustarted!! Even new purchased music won't load onto my phone! Plz help!

    Is all the media in your library? If so backup and then immediately restore the device.
    tt2

  • Why can i NOT copy from my itunes library to my Nano

    I have a Nano that was being ued on my girlfiend's old mac, but we no longer have it. Instead I want to use my computer at work as my itunes library. I have restored & reformatted the Nano to the PC, but it won't allow me to add any of the music from the itunes to the nano! What's going on?

    hiya!
    are you getting an error message? if so, what does it say? include error message numbers if you're getting any.
    or is something else going on? if so, describe what happens when you try to transfer music to the nano as best as you can. err on the side of too much detail rather than too little.
    love, b

  • Why won't the copying action stop? How do i quit it so i can shut down? Items i tried to copy to either my hard drive or my USB memory are not copying - why? And now can't quit them either!

    I have a Western Digital My Book hard drive which i use to store my media/data/back up. I tried to transfer some files on my desk top to it yestrday and it was taking forever so decided to stop it. Now it just shows under the Copying box, stopping but it isn't? I tried then to down load the same images t my USB memory stick and now that is doing the same. I wonder if i is to do with upgrading to Mavericks as no problems before?
    I have check my WD My book on another computer and thankfully all mmedia is still in tack!
    How can i quit this copying so i can shut down my computer?
    Any ideas as to why items are not copying to external memories and what if anything can i do to get it copying correctly again?
    I really need to back up my work by tonight - help! Any suggestions there too?

    option discovered in preferences. Really this and any feature that moves deletes or edits a users data should as far as possible be OFF BY DEFAULT. It shouldn't by default and without the users specific say do this dangerous and unnecessary thing without even letting the user know what it's doing!!! And then cause me a few hours (as i'm new to mac) searching for the option so as to switch it off. If i hadn't noticed the status cage declaring that it was copying files then i might never have twigged that this insane thing was occurring. And if i hadn't of noticed i would have been left maintaining the contents of the folder i copied the files to, the folder which as far as i was informed and so believed was also the location of the music files i was playing. How does Apple justify this 'genius' piece of software non-design? Surely it will hurt no one if this was off by default for new users - overall at least i dare say it would cause a lot less distress in the future for the unsuspecting public at large. Thanks for the support.

  • Why were all of my Favorites not copied to Bookmarks when I downloaded Firefox?

    All of my favorites were not copied to Bookmarks. Only favorites A-H show up in my Bookmarks, the rest of them are not there. Why did it not copy all of my Favorites?

    If there are problems with importing the IE Favorites in Firefox then export the favorites in IE to an HTML file and import that file in the Firefox Bookmarks Manager.
    If you do not have the menu bar in IE then right-click the toolbar at the top to enable the Menu Bar.
    *Export the favorites in IE to an HTML file (bookmarks.html):<br>File > Import and Export
    *Import the HTML file in Firefox:<br>Bookmarks > Show All Bookmarks > Import & Backup > Import Bookmarks from HTML
    See "Import from another browser" and "Import from file":
    *http://kb.mozillazine.org/Import_bookmarks

  • Itunes not copying all photos from an event on my iMac to iPad

    why is iTunes not copying all photos from an event on my iMac to iPad

    Not at this time. There is no connection between iPhoto on the Mac and on the iPad
    Maybe in a future release
    Suggest to Apple. IPhoto menu =>> provide iPhoto feedback
    LN

  • Aperture plugin not copying all previews

    Using "v1.1" of the plugin (or rather, it's actually 1.0.9 something)
    Looks like the plugin is does not copy over half of previews from the Aperture library.  I ran three tests on approximately 1100 photos each.
    Method:
    All photos were selected and previews deleted in Aperture. 82 photos were selected in Aperture, and small previews were generated (defined by preferences). Verified that, indeed, 82 previews existed in the Aperture library by examining the PREVIEWS directory within the library package.
    Migrated using the new plugin. Selected all options.  Searched to find all JPEGs with _Aperture_preview.jpg appended in the Lightroom target directory. Only 31 images found.  Some of the previews that did copy were side by side others that did not copy in the same project, from the same camera.  I can’t find a reason why they did not copy.
    Here’s and entry from the log:
    Failed to copy /Volumes/Photos/Aperture Library/Ashi/IMG_8250.JPG to destination directory
    Some preview files that did not copy show in the log, but most do not.
    Anyone else seeing this?  You can test if your previews copy, too, by using the method above.

    Hi,
      Had you imported a new set of images around the time the problem started?  There have been situations where a corrupted image being imported has given rise to something like what you describe.
    If the answer is "no", then suggest you do a repair, or a rebuild if that doesn't work:
    To repair or rebuild your Aperture library
    1  Close Aperture, if it’s open.
    2  Locate the Aperture library you want to fix, then hold down the Command and Option keys while double-clicking the Aperture library. The Aperture Library First Aid dialog appears.
    3  In the Aperture Library First Aid dialog, do one of the following:
    • To repair the permissions of the files within your Aperture library: Select Repairing Permissions.
    This option should be used when Aperture can’t access some of the image files within the database or Aperture is unable to open the library itself. The Repairing Permissions option reviews each file in your Aperture library and sets the read and write access of each file where appropriate, allowing Aperture to access the files again.

  • Why can I not paste from my clipboard?

    Let me say first that I do know what I am going. So here is my problem:
    I select text.
    I choose copy, of do Command-C.
    I move the cursor somewhere else, and I paste the text.
    Nothing happens.
    I am using a MacBook Air (13''), with newest version of Lion.
    Any suggestions?
    Andy

    Good suggestion.
    I did as you suggested, and no! the clipboard was empty.
    So now the question is: why can I not copy anything to the clipboard?
    Andy

  • Error: unable to copy to output directory, ReqMgmtActionsVO.xml not found

    hi,
    While running a page using jdeveloper am getting error like
    Error: unable to copy to output directory, ReqMgmtActionsVO.xml not found.
    am very thankful to the response
    Thanks
    Surya

    Hi,
    I faced the same issue.
    I fixed it by searching the missing file (In my case MyEO.xml which is a removed file) using JDeveloper (Menu Search/Search Files...).
    It found an occurence in the related .jpr file.
    In the .jpr, I deleted the related lines:
    <Item>
    <Key class="java.net.URL" path="xx/oracle/apps/.../MyEO.xml"/>
    <Value idref="15"/>
    </Item>
    That's it.
    Regards,
    Olivier

Maybe you are looking for

  • I DELETED THE BOOT CAMP DRIVE

    HELP! I was trying to install Windows Vista Home Premiun but accidentally I deleted the disk boot camp I deleted And I think it doesn't show when I want to install the Windows, How do I reinstall the Boot Camp HD? The utility works to try to install

  • Leopard and final cut pro - distortion

    Since installing leopard any audio file i export from final cut pro and then burn sounds distorted - other audio files i burn are fine - only the ones from final cut play badly. They sound fine on the computer but bad once transfered to a cd - any id

  • Replication of Sales organizational data to CRM

    Hi All, I am jus out of cocoon in this CRM world. My query is I run report CRMC_R3_ORG_GENERATE  to replicate Organizational data From ERP to CRM but i dont see any data on the screen. This obliviois ther are lots of things missing probably to call E

  • How do you reset pass code to install security update.

    I am trying to install the latest security update and I'm being asked for the security pass code which I have forgot, how do I reset it.

  • How do I get new passcode when have forgotten old and have no recent iTunes back-up

    How do I get new iPhone 5 passcode when have forgotten old passcode?  I have no recent iTunes back-up so do not want to restore from a back-up, even if I could do so without a passcode. Thanks MKP