Saving and retrieving to a file

Hi,
I wonder can anyone give the code to send and retrieve stuff to and from a text file.
Thats it,
Thanks.

cheers, I looked up the java.io package and there is a lot of suff to learn, I need a just a quick piece of code to interact with a text file.
I don't suppose you know where I can get a small snipet of code of this kind of example
Cheers,
Del

Similar Messages

  • How can I login and retrieve my user file from the trash?

    I was trying to find out where all my HD had gone, which a did using ‘What Size’.
    I found what looked like an old backup file so I put the file in the trash.
    It turns out that the file was my user file. So now I can’t login to as the user.
    How can I login and retrieve my user file from the trash?

    The Digital Editions forum is here, in case this is what you are talking about:
    http://forums.adobe.com/community/adobe_digital_editions
    If you are not, I apologize for the misunderstanding.

  • How can I store and retrieve a Word file after it's been converted to a pdf?

    How do I store and retrieve a Word file after it's been converted to an PDF?  My file has been trapped in PDF"hell" assigned to a folder that cannot be opened or read, but when deleted, also deletes the original Word file...

    I think we need some more info here like, how are you converting to PDF. This is the Reader forum and it doesn't convert files to PDF.

  • How to save and retrieve an excel file as an object into lob column?

    Hi ,
    I need to save and retrieve the whole excel file with 3 or more sheets as an object into the lob column of table.
    For example:
    t_docments
    (doc_id number,
    excel_data clob
    All excel files need to be saved to excel_data column.
    What should I do?
    Thanks

    Did you check the asktom thread posted by Jens?
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P1
    1_QUESTION_ID:232814159006
    There's example of varies file types.Yes, I did try some examples.
    Those work for .doc/.pdf/.jpg files, BUT NOT for excel file.
    The following error happened when retrieving excel file(retrieving .doc/.pdf are OK)
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 18
    ORA-06512: at "SYS.UTL_FILE", line 375
    ORA-06512: at "SYS.UTL_FILE", line 990

  • CS5 Suddenly Stops Saving and Opening PNG & GIF Files

    CS5, windoze 7, 64 bit.
    Inexplicably, CS5 just stops working with PNG & GIF format files.
    Fine, this morning; but not after lunch! Indigestion?
    Bridge says it's missing a/the java plug-in. Huh? Java is up to
    date at OS level.
    Very puzzling. Anyone got a fix for this?

    Kind of you to reply and offer assistance - thanks.
    First, I'm inquiring for my wife. I.e. I'm not the user. She's not all that comfortable with using Forums.
    I use Photo Impact - now part of Corel, as I understand it.
    She says she can't open or save those formats, as she used to be able to. But she can open PNGs
    in Illustrator.
    The bridge error message is generated on clicking bridge, when no other task is running:
    Adobe Photshop CS5 Extended
    Could not complete your request because
    Photoshop was unable to find the javascript
    plug-in.
    The mini bridge also gives an error message when clicked on, with no other task is running:
    Adobe Photshop CS5 Extended
    Cannot complete command because the
    extension could not be loaded.
    She reports that a lot of Save As options have disappeared. If this was Photoimpact, I'd be
    checking the FIO folder for the necessary fio files, but I don't know how PS manages the
    way in which various file formats become interchangeable for saving/opening. What that
    has to do with bridge, I know not. I don't know the first thing about PS.
    That said, chronologically, the problem seems to have occurred after the installation of
    a number of pre-sets. That makes me suspicious of them. Or rather, the installation
    process that they involved. But I don't know for sure, nor do I know how that installation
    of presets process might be reversed, to check if that caused the problem. (see below)
    Oh, she has executed an update, but that didn't fix the problem either.
    If there's no easy way to achieve a remedy to the problem, I'm contemplating doing a system
    restore. She's presently moving (backing-up) those pre-sets before any roll-back is attempted.

  • Excel 2010 Freezes while saving and computing when large files are opened.

    Hi
    The issue with with MS Office Excel 2010, where in if i open big files like greater than 40 or 50 mb file while saving or computing it takes lot of time
    like say 10 to 15 seconds and some times more also.
    This file i am referring is having around 5,000 row data and with around 15 sheets and has formula's and functions built into it.
    As and when i try to delete or update one of the same the status bar show processing message and starts processing from 0 to 100% this takes
    lot of time and during i feel my excel is frozen or system hanged kind of situation.
    The query is what is the limitation of file size which can be opened in Excel 2010 where i can work with the same without any freeze or hanging.
    need the same for Excel 2007 and 2013 versions also.
    Note : other office products like work, power point works fine without any issue.

    Hi,
    I didn't find the exact size of the limitation of size for Excel 2010, but as for Excel 2013, I can tell you this:
    32-bit environment is subject to 2 gigabytes (GB) of virtual address space, shared by Excel, the workbook, and add-ins that run in the same process. A data model’s share of the address space might run up to 500 – 700 megabytes (MB), but could be less if
    other data models and add-ins are loaded.
    64-bit environment imposes no hard limits on file size. Workbook size is limited only by available memory and system resources.
    I think the articles below will be very helpful to you:
    Excel specifications and limits
    For 2007:http://office.microsoft.com/en-001/excel-help/excel-specifications-and-limits-HP010073849.aspx?CTT=1
    For 2010:http://office.microsoft.com/en-001/excel-help/excel-specifications-and-limits-HP010342495.aspx?CTT=1
    For 2013:http://office.microsoft.com/en-001/excel-help/excel-specifications-and-limits-HA103980614.aspx?CTT=1
    Anyway, many factors may cause the freeze, such as hardware and add-ins, you may try starting Excel in Safe Mode to determine if it's add-ins related:
    Press Win + R and type “excel /safe” in the blank box, then press Enter.
    If there’s no problem in Safe Mode, disable the suspicious add-ins to verify which add-ins caused this issue.
    Regards,
    Melon Chen
    TechNet Community Support

  • Finding and retrieving an XML file from an application and an applet

    I have a problem.
    I have data stored in an XML file. I want to be able to call that file and store it into a document object from an application standing alone on a computer as weel as from an applet that would be running over the web.
    I don't know how to do this.
    When I use a relative path name for the application it attaches the path of the folder that contains java.exe. I could do something with the class path but this wouldn't help the end user of the application on a different computer. For similar reasons I don't want to hard code because I don't know where the final applet will be stored.
    I have a table that holds, sorts and filters the data so I want the table to collect the data, I don't want to dictate the path from the applet or the application, I want a method that is consistant with both scenarios.
    Can anyone offer some advice?

    I've just finished trying it out, here is what I did:
    String xmlDocName="filename.xml";
    java.net.URL fileURL=this.getClass().getResource(xmlDocName);
    private final String fileName = fileURL.toString().substring(6);
    The substring removes the "file:/" from the URL.
    This works fine in the IDE, I have even stored the xml file in a lower folder e.g. package_folder/xml_folder/filename.xml and replaced the xmlDocName with "xml_folder/filename.xml" and it worked fine.
    I haven't tried it in an applet because I'm running IE and as you are well aware there are problems with swing and IE applets. But you answer deserves the Duke Dollars, thank you very much.

  • Saving data retrieved from text file to JDBC table

    Hi,
    I would like to save data, loaded from a text file to a dataset, into an existing JDBC table.
    The documentation I found on this subject is very brief, and no matter how I tried, I couldn't succeed.
    I would appreciate any help.
    Thank you in advance

    Hi there,
    Here is an example of reading a String and a date from a text file. Once you have what you need in the Strings (or whatever) it should be easy to insert them into and SQL statement. Let me know if you need an example of this as well and I'll post it in the morning. Right now I'm off to bed :o)
    Cheers
    Mark
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class WriteTest {
    public static void main(String [] arg) throws Exception {          
       Date today = new Date();          
       String name = "";          
       SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyy");          
       File myfile = new File("hello.txt");               
       // how to input     
       BufferedReader in = new BufferedReader(new FileReader(myfile));          
       String name="",
       date="";          
       boolean eof = false;          
       do {
          name = in.readLine();               
          date = in.readLine();               
          if(!(eof = (name==null || date==null)))                    
          System.out.println(name+" "+formatter.parse(date));
       while(!eof);     
    }

  • I will never ever trust saving and back up my files with Apple anymore!

    I would think backing up all my files on iTunes is a safe bet.
    When I lost everything on my ipad after restoring, whatever I have backed up in iTunes was not able to sync it back into my ipad even if I chose to install it back using existing back up files on iTunes! nothing!!
    what is all this synching for if restoring doesn't even work to bring all information back into my ipad??
    Before, I was able to see all the files in an app on iTunes and now not at all!!
    If I could use strong langauge here, it would be endless!!
    My days with Apple is over!

    The iPad backs up to iTunes on your Mac.  Then, when your Mac backs up, the iPad data is backed up as well.
    Or, the iPad can back up to iCloud.
    See this Apple Support document for more info on iPad backups:
    http://support.apple.com/kb/ht1766
    A good product to back up your Mac would be an Apple Time Capsule, which is an AirPort Extreme with a built in hard drive.
    More info here.....Time Capsule

  • Question to the experts? about saving and retrieving numbers

    Question
    is there a java method to store a number in the memory and recall it
    like M+ and M- in the Microsoft Calculator?
    when the M+ button is clicked it store the numbers
    When M- button is clicked it recalls the number
    lets say ive used
    i.e using the String s method which is straight forward
    actionPerformed Event e blaah blah blah
    //add your handling code here
       String s;
            intA;
            double PhoneNumber;
            s=txtA.getText();
           A=Integer.parseInt(s);
           PhoneNumber= (double)Math.round(A);
           s=String.valueOf(PhoneNumber);
          txtRexhaul.setText(s);now when the M+ button is clicked it stores both the values in "txtA" and "PhoneNumber"
    and when the M- button is clicked it recalls the stored numbers and sets it back
    using the .setText("") method in "txtA" and "PhoneNumber"
    is this possible ?
    Solutions are appreciated thanks again
    Edited by: AK-Emm on Sep 27, 2008 2:30 PM

    oh ok
    lets use stack then ilike node
    if it will work just like storing numbers on a calculator M+ and M- functions this is a stack method
    class Node {
       String item;
       Node next;
    Node first  = new Node();
    Node second = new Node();
    first.item  = "1222441"; // Clients phone number lets say mine Rexhaul Cartier
    second.item = "33322211"; // Clients phone number lets say yours
    Node old first=first;
    first=first.next; //when the M- button is clickedi get stuck after this i need to simplify this thats where your expertise comes in,
    example of a calculator lets say a standard has a Store Button M+ and a recall Button M-
    with the String S method as mentioned earlier
    when the M+ button is clicked it stores both Textfield "A" and TextField "RexhaulCartier"
    when the M- button is clicked it recalls the stored number just like setText(); to the selected textFields
    let me simplify this i.e ?---> A // what goes into A
    A=1// you type the value
    1(store)---> A // stores 1 in variable A when M+ button is clicked
    RCL A// recall what was stored in variable A by clicking M- button
    A= 1
    you get the picture?
    i.e if you use Microsoft OS i.e Vista Xp 2000 etc run the calculator in accessories youll see what i mean
    when you want to store the answer you press the M+ button when you want to recall it you press M- it displays the stored answer thanks for your time to help me out i really appreciate your help p....
    Edited by: AK-Emm on Sep 27, 2008 3:29 PM

  • Saving word doc in database and retrieving

    hai all,
    Is it possible to save a word file in database and retrieve the word file in web dynpro application?
    Thanks n Regards
    Sharanya.R

    Hi,
    To save the wordfile to the database make use of lob types.
    Make use of JDBC to do this.
    retreiving
    Make use of JDBC to fetch the previously saved doc.
    Populate a context of type IWDResource(Nw04s onwards) or  Binary(Nwo4).
    Set the appropriate  mime type
    Create a filedownload and bind this.
    Regards
    Ayyapparaj

  • Saving strings in user prefs file

    Hi all,
    I'm experimenting with user preferences. The IB interface works okay, and the panel appears when selected from the 'Preferences...' menu item. I do have one slight issue with it, but I'll deal with that as a separate question later.
    In the meantime, I just want to store (1) a name string and (2) an address string , but all the example code I've been able to find has dealt with storing data objects only. Now if I've got this right NSStrings don't need to be stored as objects, so how do I modify my code to achieve this?
    Here's my 'PrefsController' header file:
    // PrefsController.h
    #import <Cocoa/Cocoa.h>
    extern NSString *nameKey;
    extern NSString *addressKey;
    @interface PrefsController : NSWindowController
    IBOutlet NSTextField *nameField;
    IBOutlet NSTextField *addressField;
    <snip>
    @end
    ...my 'PrefsController' main file:
    // PrefsController.m
    #import "PrefsController.h"
    NSString *nameKey = @"name";
    NSString *addressKey = @"address";
    @implementation PrefsController
    -(id)init
    self = [super initWithWindowNibName:@"Preferences"];
    return self;
    <snip>
    @end
    ...and finally, my 'AppController' main file, where the problem lies:
    // AppController.m
    #import "AppController.h"
    #import "PrefsController.h"
    @implementation AppController
    + (void) initialize
    // Create a (mutable?) dictionary
    NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
    //••• usual place for NSData object below •••
    //••• place for unknown default values below •••
    [first default value];
    [second default value];
    // Register the default dictionary
    [[NSUserDefaults standardUserDefaults] registerDefaults: defaultValues];
    NSLog(@"registered defaults: %@", defaultValues);
    <snip>
    @end
    As you can see, the problem is in AppController.m, with (1) the omission of an NSData object, and (2) the unknown default values required.
    Since this test app will never be asked to do more than swap two strings, another thing I'm curious to learn is if I could use a plain NSDictionary instead of a mutable one?
    Any help would be much appreciated. Thanks!
    Ernie

    Hehehe..... Thanks again, phunkjoker. The bindings fixed this issue in seconds! The prefs function is now creating a file in Library/Preferences/ and saving and retrieving strings. Dammit, I love this Cocoa.
    While all the demo code I've managed to find makes no mention of Shared User Defaults, I can see how useful (even critical) this is, but realise such 'refinements' probably won't find their way into bare-bones examples.
    Unfortunately, because I've been on such a roll with the practical stuff I've far outpaced my understanding of Cocoa theory, and will spend the next few days going through the docs -- in particular, the ones you listed. In one way, getting ahead of myself is good because the material is going to make a lot more sense as I read it. Also understood what you said about the '+' initializer.
    In the meantime, I actually do have two much smaller issues remaining...
    (1) The prefs panel has two NSTextFields labelled 'email' and 'login' respectively (required for ID as part of a header in my text file output, rather than indicating any grandiose plans on my part to mess in these areas). I noticed that in order for any changes to be saved, I must subsequently click or tab *out of the box* again (into the remaining field) before quitting out.
    (2) The example app I followed has no 'Okay' button, and therefore no means of disposing of the prefs panel other than quitting. Now, after much searching, the most likely candidate I found was orderOut:. Putting this in my 'prefsController.m' file as an 'Okay' button action, I have:
    -(IBAction)okayPrefs:(id)sender
    NSBeep(); // my code required here
    [window orderOut:self]; //••• experimental
    As it stands, the build fails due to 'error: 'window' undeclared (first use in this function)'. Declaring 'window' in 'prefsController.h' like this:
    @interface PrefsController : NSWindowController
    IBOutlet NSTextField *emailField;
    IBOutlet NSTextField *loginField;
    IBOutlet NSPanel *window; //••• experimental
    -(IBAction)okayPrefs:(id)sender;
    -(IBAction)cancelPrefs:(id)sender;
    @end
    ...allows it to build successfully, but has no effect when I click the button. Any guidance on these items please, or should I float them in a separate post?
    Ernie

  • Polling a particular directory, retrieving only new files

    Hi,
    I have a requirement of polling a particular directory, and retrieving all new files posted. Say, i have a file called file1 in a particular directory, i keep polling the same directory every "n" minutes or even seconds, and will try to fetch file1 only when there is a semaphore file called file1.ready exists for file1.
    This is in Solaris.
    How can this be implemented?. Any help will be greatly appreciated.
    Thanks

    Take a look at java.io.File which represents an abstract path such as a directory or file. You'll probably be particularly interested in File.exists().

  • Polling a particular directory, retrieve only new file(s)?

    Hi,
    I have a requirement of polling a particular directory, and retrieving all new files posted. Say, i have a file called file1 in a particular directory, i keep polling the same directory every "n" minutes or even seconds, and will try to fetch file1 only when there is a semaphore file called file1.ready exists for file1.
    This is in Solaris.
    How can this be implemented?. Any help will be greatly appreciated.
    Thanks

    you can use the file modified dates to figure out whats new and whats old.
    May be you can compare them against the last time that you ran the process.

  • When I attach a JPG file in my email and send it to a Windows friend they get the message "The file type being saved or retrieved has been blocked when they try to open it." Anyone know why and how to fix this problem?

    When I attach a JPG file in my email message and send it to a Windows friend they get the message "The file type being saved or retrieved has been blocked when they try to open it so that they can save it." Anyone know why and how to fix this problem?

    Your Windows friend should ask in a Windows forum why his email client won't open attached jpg files. We have no idea what email client he is using or how his Windows security is configured.

Maybe you are looking for