How do I write the contents of a string array to file?  Is there a package

freely avaliable to do this? I am writing a console program that will save the selections made to file. I have convenience packages that came with my book, it allows int and double arrays to be written to file, but not string arrays. Any help would be greatly appreciated.
Thanks,
Joe Lavender

One easy way to do this is to populate a Properties object with the index as the key and the element as the value.
The properties has built in methods for writing it to file and reading it in.

Similar Messages

  • How do I change the contents of a string when I click on an image?

    I have hundreds of images that need to play a unique sound when clicked.  In order to simplify the building of this flash file I need to streamline it in a way that will allow me to change only one word.  Below is some example code.  I think the reason it doesnt work is that I am declaring "word" twice...any suggestions anybody?  Thanks in advance...
    import flash.events.MouseEvent;
    stop()
    var word:String = "family"
    trace (word + "_nv")
    this[word+ "_nv"].addEventListener(MouseEvent.CLICK, playaudio);
    this[word+"_nv"].buttonMode = true;
    var word:String = "grandchildren"
    trace (word + "_nv")
    this[word+ "_nv"].addEventListener(MouseEvent.CLICK, playaudio);
    this[word+ "_nv"].buttonMode = true;
    function playaudio (event:MouseEvent):void{
    this[word+"_nv"].play()

    I don't see where what you show is streamlining anything.  It would save code to just use the strings instead of assigning the string to variables and using the variables.  In any case. yes, you do not want to declare the same variable twice (use "var" only once).  And your playaudio function will only work with whatever the last value of "word" that you assign.
    To streamline the code you could name each mc using a numeric increment (mc_1, mc_2, mc_3, etc), and then assign your listener in just a few lines using a loop.  In the play audio function you could use the instance name of the event.currentTarget...
    this[event.currentTarget.name].play();
    or even
    MovieClip(event.currentTarget).play();

  • How do i write the sign " inside a String?

    i need to use the sign " as a delimiter in StringTokenizer.

    try using backslash for escape character: \"

  • How to write the contents of string buffer to a file

    hi all
    how is it possible to write the contents of a string buffer to a new file (ie i have to create a file and write in it )
    this my string buffer
    StringBuffer s=new StringBuffer();
    s.append("<html><head><title>Welcome</title>");
    s.append("</head>");
    s.append("<body>");
    s.append("<b> Hello,");
    s.append(output);
    s.append(" You have been Sucessfully authenticated</b>");
    s.append("</body></html>");
    so please can anyone help me

    for nice examples of how to do things you may look int [url http://javaalmanac.com]Java Almanac
    or more specifficly: [url http://javaalmanac.com/egs/java.io/WriteToFile.html?l=find]Writin to a File
    in case you don't know how to apply that example on your code, since you have StringBuffer instead of String, then look at [url http://java.sun.com/j2se/1.4.2/docs/api/]API Specification of [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html]StringBuffer, and see if there is some method like toString() or similar, that would help you convert your StringBuffer to a String.

  • Write the content to UCM

    Hi,
    How to write the content to UCM with VCR adapter?
    Is there any API to do this?
    Any clues..........
    Thanks in Advance,
    Venu--

    Hi Venu,
    This isn't available with the current adapter but will come with the upcoming WebLogic Portal "Sunshine" release.
    -Ryan

  • Is content viewed during "private browsing" forensically extractable? e.g does it still write the content to the disk and can it be recovered?

    is content viewed during "private browsing" forensically extractable? e.g does it still write the content to the disk and can it be recovered?
    If a forensic investigator was to do forensics on my disk after i browsed content under private browsing, could it be recovered
    There is no intention to use this for illegall purposes, i just wondered how to private is "private browsing"

    Private browsing basically prevents any data from being stored in your Profile folder. [http://support.mozilla.com/en-US/kb/Private%20Browsing This] article provides more details.
    Please note that cookies '''are '''created during a private browsing session. However, they are deleted once the session is ended or when you exit Firefox application.
    Also note that other applications on your computer might be tracking which sites you visit (firewall, antivirus etc). They will still be able to collect your browsing related data even if you have activated private browsing in Firefox.

  • How-to list the contents of a Data Pump Export file?

    How can I list the contents of a 10gR2 Data Pump Export file? I'm looking at the Syntax Diagram for Data Pump Import and can't see a list-only option.
    Regards,
    Al Malin

    use the parameter SQLFILE in the impdp which writes all the sql ddl's to the specified file.
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_import.htm
    SQLFILE
    Default: none
    Purpose
    Specifies a file into which all of the SQL DDL that Import would have executed, based on other parameters, is written.
    Syntax and Description
    SQLFILE=[directory_object:]file_name
    The file_name specifies where the import job will write the DDL that would be executed during the job. The SQL is not actually executed, and the target system remains unchanged. The file is written to the directory object specified in the DIRECTORY parameter, unless another directory_object is explicitly specified here. Any existing file that has a name matching the one specified with this parameter is overwritten.
    Note that passwords are not included in the SQL file. For example, if a CONNECT statement is part of the DDL that was executed, it will be replaced by a comment with only the schema name shown. In the following example, the dashes indicate that a comment follows, and the hr schema name is shown, but not the password.
    -- CONNECT hr
    Therefore, before you can execute the SQL file, you must edit it by removing the dashes indicating a comment and adding the password for the hr schema (in this case, the password is also hr), as follows:
    CONNECT hr/hr
    For Streams and other Oracle database options, anonymous PL/SQL blocks may appear within the SQLFILE output. They should not be executed directly.
    Example
    The following is an example of using the SQLFILE parameter. You can create the expfull.dmp dump file used in this example by running the example provided for the Export FULL parameter. See FULL.
    impdp hr/hr DIRECTORY=dpump_dir1 DUMPFILE=expfull.dmpSQLFILE=dpump_dir2:expfull.sql
    A SQL file named expfull.sql is written to dpump_dir2.
    Message was edited by:
    Ranga
    Message was edited by:
    Ranga

  • How can i get the content of JTextArea with out loosing Indentation.

    I am developing one mail sending application. I am getting mailid , from address, mail body from one Swing. In one JTextArea i am typing i have typed some matter. When i call the content of JTextArea using
    jtx.getText() method, i am getting all the content as one paragraph. That means there is no indentation which was there in TextArea.
    Please provide me some solution how can i get the content of JTextArea wiht out loosing indentation.

    And it was you who asked the question!

  • IPod classic content is missing from my iTunes library after a reinstallation of Windows 7 on my PC. How do I restore the contents of my iPod classic to my iTunes library WITHOUT losing that content on my iPod?

    iPod classic content is missing from my iTunes library after a reinstallation of Windows 7 on my PC. How do I restore the contents of my iPod classic to my iTunes library WITHOUT losing that content on my iPod?

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

    My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

    My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

  • How do you transfer the content from an iPhone to a PC? I have to use a PC for a while and don't know how to put my stuff on to there from my phone

    How do you transfer the content from an iPhone to a PC? I have to use a PC for a while and don't know how to put my stuff on to there from my phone

    If you're talking about music and movies an i-device was not designed for unique storage of media. It is not a backup device and media transfer was planned with you maintaining a master copy of your media on a computer which is itself properly backed up against loss. Syncing music and movies is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer. The exception is iTunes Store purchases which can be transferred from a device to a computer.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer - http://support.apple.com/kb/HT1848 - only purchases from iTunes Store
    For transferring other items from an i-device to a computer you will have to use third party commercial software.  See this document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991

  • I got some books from the itunes store and put them into my library.  I created a playlist so that I could burn them to cds.  The title is there but no contents.  It won't even play the playlist.  How do I get the contents of the book?

    I got some books from the itunes store and put them into my library.  I created a playlist so that I could burn them to cds.  It won't even play the book, there are no contents.  How do I get the contents of the book?

    I'm guessing this is a problem unique to me as there have been no replies at all...  Thanks a bunch folks

  • How can i write the below code using "For all entries"

    Hi
    How can we write the below code using "for all entries" and need to avoid joins...
    Please help
    SELECT aaufnr aobjnr aauart atxjcd a~pspel
    agstrp awerks carbpl cwerks
    INTO TABLE t_caufv
    FROM caufv AS a
    INNER JOIN afih AS b
    ON aaufnr = baufnr
    INNER JOIN crhd AS c
    ON bgewrk = cobjid
    AND c~objty = 'D'
    WHERE ( a~pspel = space
    OR a~txjcd = space
    OR NOT a~objnr IN
    ( select OBJNR from COBRB AS e
    WHERE objnr = a~objnr ) )
    AND a~werks IN s_plant
    AND a~auart IN s_wtype
    AND NOT a~objnr IN
    ( select OBJNR from JEST AS d
    WHERE objnr = a~objnr
    AND ( dstat = 'A0081'OR dstat = 'A0018' )
    AND d~inact 'X' ).
    Reward points for all helpfull answers
    Thanks
    Ammi.

    Hi,
    SELECT objnr objid aufnr
            from afih
            into table t_afih.
    SELECT objnr
            from JEST
            into table t_JEST
            where stat = 'A0045'
               OR stat = 'A0046'
               AND inact 'X'.
    SELECT objnr
            from COBRB
            into table t_cobrb.
    SELECT arbpl werks objid objty
          from crhd
          INTO table it_crhd
          FOR ALL ENTRIES IN it_afih
          WHERE objty eq 'D'
          AND gewrk = it_afih-objid.
    SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
            FROM caufv
            INTO table t_caufv
            FOR ALL ENTRIES IN it_afih
            WHERE aufnr = it_afih-aufnr
              And pspel = ' '
              AND txjcd = ' '
             ANd objnr ne it_crhd-objnr
              AND auart in s_wtype
              AND werks in s_plant.
             AND objnr ne it_jest-objnr.
    dont use NE in the select statements, it may effect performance also. Instead use if statements inside
    loops.
    loop at t_caufv.
    read table it_chrd............
      if t_caufv-objnr ne it_chrd-objnr.
      read table it_jest..........
       if   if t_caufv-objnr ne it_jest-objnr.
        (proceed further).
       endif.
      endif.
    endloop.
    hope this helps.
    Reward if useful.
    Regards,
    Anu

  • How can I view the contents of a free trial for adobe fireworks cs6 on mac

    how can I view the contents of a free trial for adobe fireworks cs6 on mac.
    My friend told me to find the application in finder then hit control and click it and then it should give you the option to click
    "view package contents"
    This was not the case
    please help thank you

    When posting in Apple Communties/Forums/Message Boards.......It would help us to know which iMac model you have, which OS & version you're using, how much RAM, etc. You can have this info displayed on the bottom of every post by completing your system profile and filling in the information asked for.
    CLICKY CLICK---> https://discussions.apple.com/docs/DOC-3602
    CLICKY CLICK-----> Help us to help you on these forums

  • How do you limit the content of Launch pad screens

    How do you limit the content of Launch pad screens - mine is cluttered with many applications - which are all valid - but many are so raely used they are causing me to have two screes - I want one screen possibly half filled. Can anybody help...

    I believe you need to manually delete them one at a time..
    Are the emails from an IMAP account(s)

Maybe you are looking for

  • Camera not working after upgrade to io5

    Hi i have just updated to io5 and icloud which are fine except the camera does not seem to work anybody same

  • Sharing external hard drives

    Hi folks, I have recently started to use Time Machine and I own two Macs, a MBPro and an iMac. The external disks (two) are FireWire and formatted to HFS+, and stay connected all the time to the iMac. Both Macs are running Leopard updated to 10.5.6.

  • Http Errors in VPN Logs

    Hi, I am having very strange type of errors for our Webvpn users in the logs below: 11405 03/24/2005 22:45:35.080 SEV=4 HTTP/50 RPT=58 81.158.96.133 HTTP 404 Not Found (/_vti_inf.html) 11406 03/24/2005 22:45:35.160 SEV=4 HTTP/50 RPT=59 81.158.96.133

  • Error while loading data through flat files

    Hi, I am laoding data through flat files I loaded the data in development & then transported it to Quality  system  for doing Integration testing & loaded the data in Quality  system  & data loading was successful But we do the regression testing in

  • Plan data in special ledger in company code curremcy

    Hi, I am posting plan data to a special ledger but it is very estrange because I post it in KP06 transaction, I enter data in EUR but when I display my Special ledger line items I appears as transaction Currency the company code currency, not EUR Is