Need Help with file manipulation

I need to read a file, insert data dynamically based on a user input in this file. How do I do it?

First of all, don't cross-post
http://forum.java.sun.com/thread.jsp?thread=296364&forum=4&message=1170079

Similar Messages

  • Need Help With File Matching Records

    I need help with my file matching program.
    Here is how it suppose to work: FileMatch class should contain methods to read oldmast.txt and trans.txt. When a match occurs (i.e., records with the same account number appear in both the master file and the transaction file), add the dollar amount in the transaction record to the current balance in the master record, and write the "newmast.txt" record. (Assume that purchases are indicated by positive amounts in the transaction file and payments by negative amounts.)
    When there is a master record for a particular account, but no corresponding transaction record, merely write the master record to "newmast.txt". When there is a transaction record, but no corresponding master record, print to a log file the message "Unmatched transaction record for account number ..." (fill in the account number from the transaction record). The log file should be a text file named "log.txt".
    Here is my following program code:
    // Exercise 14.8: CreateTextFile.java
    // creates a text file
    import java.io.FileNotFoundException;
    import java.lang.SecurityException;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import java.util.NoSuchElementException;
    import java.util.Scanner;
    import org.egan.AccountRecord;
    import org.egan.TransactionRecord;
    public class CreateTextFile
      private Formatter output1;  // object used to output text to file
      private Formatter output2;  // object used to output text to file
      // enable user to open file
      public void openTransFile()
        try
          output1 = new Formatter("trans.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openTransFile
      // enable user to open file
      public void openOldMastFile()
        try
          output2 = new Formatter("oldmast.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openOldMastFile
      // add transaction records to file
      public void addTransactionRecords()
        // object to be written to file
        TransactionRecord record1 = new TransactionRecord();
        Scanner input1 = new Scanner(System.in);
        System.out.printf("%s\n%s\n%s\n%s\n\n",
          "To terminate input, type the end-of-file indicator",   
          "when you are prompted to enter input.",
          "On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
          "On Windows type <ctrl> z then press Enter");
        System.out.printf("%s\n%s",
           "Enter account number (> 0) and amount.","? ");
        while (input1.hasNext())  // loop until end-of-file indicator
          try // output values to file
            // retrieve data to be output
            record1.setAccount(input1.nextInt());    // read account number
            record1.setAmount(input1.nextDouble());  // read amount
            if (record1.getAccount() > 0)
              // write new record
              output1.format("%d %.2f\n", record1.getAccount(), record1.getAmount());
            } // end if
            else
              System.out.println("Account number must be greater than 0.");
            } // end else
          } // end try
          catch (FormatterClosedException formatterClosedException)
            System.err.println("Error writing to file.");
            return;
          } // end catch
          catch (NoSuchElementException elementException)
            System.err.println("Invalid input. Please try again.");
            input1.nextLine(); // discard input so user can try again
          } // end catch
          System.out.printf("%s %s\n%s", "Enter account number (> 0) ",
            "and amount.","? ");
        } // end while
      } // end method addTransactionRecords
      // add account records to file
      public void addAccountRecords()
        // object to be written to file
        AccountRecord record2 = new AccountRecord();
        Scanner input2 = new Scanner(System.in);
        System.out.printf("%s\n%s\n%s\n%s\n\n",
          "To terminate input, type the end-of-file indicator",   
          "when you are prompted to enter input.",
          "On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
          "On Windows type <ctrl> z then press Enter");
        System.out.printf("%s\n%s",
           "Enter account number (> 0), first name, last name and balance.","? ");
        while (input2.hasNext())  // loop until end-of-file indicator
          try // output values to file
            // retrieve data to be output
            record2.setAccount(input2.nextInt());    // read account number
            record2.setFirstName(input2.next());      // read first name
            record2.setLastName(input2.next());       // read last name
            record2.setBalance(input2.nextDouble());  // read balance
            if (record2.getAccount() > 0)
              // write new record
              output2.format("%d %s %s %.2f\n", record2.getAccount(), record2.getFirstName(),
                record2.getLastName(), record2.getBalance());
            } // end if
            else
              System.out.println("Account number must be greater than 0.");
            } // end else
          } // end try
          catch (FormatterClosedException formatterClosedException)
            System.err.println("Error writing to file.");
            return;
          } // end catch
          catch (NoSuchElementException elementException)
            System.err.println("Invalid input. Please try again.");
            input2.nextLine(); // discard input so user can try again
          } // end catch
          System.out.printf("%s %s\n%s", "Enter account number (> 0),",
            "first name, last name and balance.","? ");
        } // end while
      } // end method addAccountRecords
      // close file
      public void closeTransFile()
        if (output1 != null)
          output1.close();
      } // end method closeTransFile
      // close file
      public void closeOldMastFile()
        if (output2 != null)
          output2.close();
      } // end method closeOldMastFile
    } // end class CreateTextFile--------------------------------------------------------------------------------------------------
    // Exercise 14.8: CreateTextFileTest.java
    // Testing class CreateTextFile
    public class CreateTextFileTest
       // main method begins program execution
       public static void main( String args[] )
         CreateTextFile application = new CreateTextFile();
         application.openTransFile();
         application.addTransactionRecords();
         application.closeTransFile();
         application.openOldMastFile();
         application.addAccountRecords();
         application.closeOldMastFile();
       } // end main
    } // end class CreateTextFileTest-------------------------------------------------------------------------------------------------
    // Exercise 14.8: TransactionRecord.java
    // A class that represents on record of information
    package org.egan; // packaged for reuse
    public class TransactionRecord
      private int account;
      private double amount;
      // no-argument constructor calls other constructor with default values
      public TransactionRecord()
        this(0,0.0); // call two-argument constructor
      } // end no-argument AccountRecord constructor
      // initialize a record
      public TransactionRecord(int acct, double amt)
        setAccount(acct);
        setAmount(amt);
      } // end two-argument TransactionRecord constructor
      // set account number
      public void setAccount(int acct)
        account = acct;
      } // end method setAccount
      // get account number
      public int getAccount()
        return account;
      } // end method getAccount
      // set amount
      public void setAmount(double amt)
        amount = amt;
      } // end method setAmount
      // get amount
      public double getAmount()
        return amount;
      } // end method getAmount
    } // end class TransactionRecord -------------------------------------------------------------------------------------------------
    // Exercise 14.8: AccountRecord.java
    // A class that represents on record of information
    package org.egan; // packaged for reuse
    import org.egan.TransactionRecord;
    public class AccountRecord
      private int account;
      private String firstName;
      private String lastName;
      private double balance;
      // no-argument constructor calls other constructor with default values
      public AccountRecord()
        this(0,"","",0.0); // call four-argument constructor
      } // end no-argument AccountRecord constructor
      // initialize a record
      public AccountRecord(int acct, String first, String last, double bal)
        setAccount(acct);
        setFirstName(first);
        setLastName(last);
        setBalance(bal);
      } // end four-argument AccountRecord constructor
      // set account number
      public void setAccount(int acct)
        account = acct;
      } // end method setAccount
      // get account number
      public int getAccount()
        return account;
      } // end method getAccount
      // set first name
      public void setFirstName(String first)
        firstName = first;
      } // end method setFirstName
      // get first name
      public String getFirstName()
        return firstName;
      } // end method getFirstName
      // set last name
      public void setLastName(String last)
        lastName = last;
      } // end method setLastName
      // get last name
      public String getLastName()
        return lastName;
      } // end method getLastName
      // set balance
      public void setBalance(double bal)
        balance = bal;
      } // end method setBalance
      // get balance
      public double getBalance()
        return balance;
      } // end method getBalance
      // combine balance and amount
      public void combine(TransactionRecord record)
        balance = (getBalance() + record.getAmount()); 
      } // end method combine
    } // end class AccountRecord -------------------------------------------------------------------------------------------------
    // Exercise 14.8: FileMatch.java
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.util.NoSuchElementException;
    import java.util.Scanner;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import org.egan.AccountRecord;
    import org.egan.TransactionRecord;
    public class FileMatch
      private Scanner inTransaction;
      private Scanner inOldMaster;
      private Formatter outNewMaster;
      private Formatter theLog;
      // enable user to open file
      public void openTransFile()
        try
          inTransaction = new Scanner(new File("trans.txt"));
        } // end try
        catch (FileNotFoundException fileNotFoundException)
          System.err.println("Error opening file.");
          System.exit(1);
        } // end catch
      } // end method openTransFile
      // enable user to open file
      public void openOldMastFile()
        try
          inOldMaster = new Scanner(new File("oldmast.txt"));
        } // end try
        catch (FileNotFoundException fileNotFoundException)
          System.err.println("Error opening file.");
          System.exit(1);
        } // end catch
      } // end method openOldMastFile
      // enable user to open file
      public void openNewMastFile()
        try
          outNewMaster = new Formatter("newmast.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openNewMastFile
      // enable user to open file
      public void openLogFile()
        try
          theLog = new Formatter("log.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openLogFile
      // update records
      public void updateRecords()
        TransactionRecord transaction = new TransactionRecord();
        AccountRecord account = new AccountRecord();
        try // read records from file using Scanner object
          System.out.println("Start file matching.");
          while (inTransaction.hasNext() && inOldMaster.hasNext())
            transaction.setAccount(inTransaction.nextInt());     // read account number
            transaction.setAmount(inTransaction.nextDouble());   // read amount
            account.setAccount(inOldMaster.nextInt());     // read account number
            account.setFirstName(inOldMaster.next());      // read first name 
            account.setLastName(inOldMaster.next());       // read last name
            account.setBalance(inOldMaster.nextDouble());  // read balance
            if (transaction.getAccount() == account.getAccount())
              while (inTransaction.hasNext() && transaction.getAccount() == account.getAccount())
                account.combine(transaction);
                outNewMaster.format("%d %s %s %.2f\n",
                account.getAccount(), account.getFirstName(), account.getLastName(),
                account.getBalance());
                transaction.setAccount(inTransaction.nextInt());     // read account number
                transaction.setAmount(inTransaction.nextDouble());   // read amount
            else if (transaction.getAccount() != account.getAccount())
              outNewMaster.format("%d %s %s %.2f\n",
              account.getAccount(), account.getFirstName(), account.getLastName(),
              account.getBalance());         
              theLog.format("%s%d","Unmatched transaction record for account number ",transaction.getAccount());
          } // end while
          System.out.println("Finish file matching.");
        } // end try
        catch (NoSuchElementException elementException)
          System.err.println("File improperly formed.");
          inTransaction.close();
          inOldMaster.close();
          System.exit(1);
        } // end catch
        catch (IllegalStateException stateException)
          System.err.println("Error reading from file.");
          System.exit(1);
        } // end catch   
      } // end method updateRecords
      // close file and terminate application
      public void closeTransFile()
        if (inTransaction != null)
          inTransaction.close();
      } // end method closeTransFile
      // close file and terminate application
      public void closeOldMastFile()
        if (inOldMaster != null)
          inOldMaster.close();
      } // end method closeOldMastFile
      // close file
      public void closeNewMastFile()
        if (outNewMaster != null)
          outNewMaster.close();
      } // end method closeNewMastFile
      // close file
      public void closeLogFile()
        if (theLog != null)
          theLog.close();
      } // end method closeLogFile
    } // end class FileMatch-------------------------------------------------------------------------------------------------
    // Exercise 14.8: FileMatchTest.java
    // Testing class FileMatch
    public class FileMatchTest
       // main method begins program execution
       public static void main( String args[] )
         FileMatch application = new FileMatch();
         application.openTransFile();
         application.openOldMastFile();
         application.openNewMastFile();
         application.openLogFile();
         application.updateRecords();
         application.closeLogFile();
         application.closeNewMastFile();
         application.closeOldMastFile();
         application.closeTransFile();
       } // end main
    } // end class FileMatchTest-------------------------------------------------------------------------------------------------
    Sample data for master file:
    Master file                         
    Account Number            Name                     Balance
    100                            Alan Jones                   348.17
    300                            Mary Smith                    27.19
    500                            Sam Sharp                   0.00
    700                            Suzy Green                   -14.22Sample data for transaction file:
    Transaction file                    Transaction
    Account Number                  Amount
    100                                         27.14
    300                                         62.11
    300                                         83.89
    400                                         100.56
    700                                         80.78
    700                                         1.53
    900                                         82.17  -------------------------------------------------------------------------------------------------
    My FileMatch class program above has bugs in it.
    The correct results for the newmast.txt:
    100  Alan  Jones  375.31
    300  Mary  Smith  173.19
    500  Sam  Sharp  0.00
    700  Suzy Green  68.09The correct results for the log.txt:
    Unmatched transaction record for account number 400Unmatched transaction record for account number 900------------------------------------------------------------------------------------------------
    My results for the newmast.txt:
    100 Alan Jones 375.31
    300 Mary Smith 111.08
    500 Sam Sharp 0.00
    700 Suzy Green -12.69My results for the log.txt
    Unmatched transaction record for account number 700-------------------------------------------------------------------------------------------------
    I am not sure what is wrong with my code above to make my results different from the correct results.
    Much help is appreciated. Please help.

    From the output, it looks like one problem is just formatting -- apparently you're including a newline in log entries and not using tabs for the newmast output file.
    As to why the numbers are off -- just from glancing over it, it appears that the problem is when you add multiple transaction values. Since account.combine() is so simple, I suspect that you're either adding creating transaction objects incorrectly or not creating them when you should be.
    Create test input data that isolates a single case of this (e.g., just the Mary Smith case), and then running your program in a debugger or adding debugging code to the add/combine method, so you can see what's happening in detail.
    Also I'd recommend reconsidering your design. It's a red flag if a class has a name with "Create" in it. Classes represent bundles of independant state and transformations on that state, not things to do.

  • PHP disaster with entropy installation need help with file location

    I have a mac mini snow leopard server running 10.6.5 ,and I was trying to resolve a mcrypt module issue so that I could install wordpress and magento on some of our sites.After doing what I thought was extensive research, I decided to download the entropy php 5.30-3pkg from Marc Liyanage since it was already compiled and had an automatic install.I had the xcode tools installed and was going to attempt to compile it myself,but did not quite understand the instructions on Michael Gracie's site.When I installed the entropy package it told me that i needed to first disable the existing module,and I attempted to uncheck the php5 module,with no luck,as every time I tried to save it it rechecked itself,which I later discovered was happening because of dependency issues, as I had the mail,wiki,etc services on the sites checked. So my problem is that I wasn't aware at the time of the dependency issue,and I just renamed the module and the file name by putting a # in front of both (Inside the server admin dialog box through the pop up window).I didn't think it would hurt since is was going to be disabled,but now i get blank pages when trying to connect,and can't even see a test.php file, nor can I even locate where they say:
    software is supposed to be installed into a new directory /usr/local/php5 on my boot volume. If you ever want to get rid of the package, you only have to remove this directory and a symbolic link called +entropy-php.conf in either /etc/apache2/sites or /etc/apache2/other, depending on whether you run OS X Client or Server.
    Any help would be appreciated !

    Thank you so much, that works just like i wanted it to as it downloads the file but then i have the problem of the file being called firename.png (or whatever i put in there instead)
    using this i changed the code and made it this instead which works 100%
    set download to text returned of (display dialog "Enter IGN" default answer "" buttons {"Download", "Cancel"} default button 1)
    set the destination to (choose folder)
    do shell script "curl -L http://minecraft.net/skin/" & download & ".png" & " -o " & quoted form of ((POSIX path of the destination) & download & ".png")
    so i used the input name again with download and added a .png for the extention and now it downloads the file to the locaiton i specify with the name of the user im entering with the correct exention, 100% awesome ^^
    Thank you everyone who help me with that issue, grately appreshiated

  • Need help with File system creation fro Oracle DB installation

    Hello,
    I am new to Solaris/Unix system landscape. I have a Sun enterprise 450 with 18GB hard drive. It has Solaris 9 on it and no other software at this time. I am planning on adding 2 more hard drives 18gb and 36gb to accommodate Oracle DB.
    Recently I went through the Solaris Intermediate Sys admin training, knows the basic stuff but not fully confident to carry out the task on my own.
    I would appreciate some one can help me with the sequence of steps that I need perform to
    1. recognize the new hard drives in the system,
    2. format,
    3. partition. What is the normal strategy for partitioning? My current thinking is to have 36+18gb drives as data drives. This is where I am little bit lost. Can I make a entire 36GB drive as 1 slice for data, I am not quite sure how this is done in the real life, need your help.
    4. creating the file system to store the database files.
    Any help would be appreciated.

    Hello,
    Here is the rough idea for HA from my experience.
    The important thing is that the binaries required to run SAP
    are to be accessible before and after switchover.
    In terms of this file system doesn't matter.
    But SAP may recommend certain filesystem on linux
    please refer to SAP installation guide.
    I always use reiserfs or ext3fs.
    For soft link I recommend you to refer SAP installation guide.
    In your configuration the files related to SCS and DB is the key.
    Again those files are to be accessible both from hostA and from hostB.
    Easiest way is to use share these files like NFS or other shared file system
    so that both nodes can access to these files.
    And let the clustering software do mount and unmount those directory.
    DB binaries, data and log are to be placed in shared storage subsystem.
    (ex. /oracle/*)
    SAP binaries, profiles and so on to be placed in shared storage as well.
    (ex. /sapmnt/*)
    You may want to place the binaries into local disk to make sure the binaries
    are always accessible on OS level, even in the connection to storage subsystem
    losts.
    In this case you have to sync the binaries on both nodes manually.
    Easiest way is just put on shared storage and mount them!
    Furthermore you can use sapcpe function to sync necessary binaries
    from /sapmnt to /usr/sap/<SID>.
    For your last question /sapmnt should be located in storage subsystem
    and not let the storage down!

  • Need help with File to SOAP sync scenario: NO_BACK_SYSTEM_IN_HOPLIST

    Hello,
    I am setting up a new scenario where I get an XML file with PI, send that content via sync SOAP receiver call and direct the result of the web service response to SAP (just back to file as intermediate step).
    So far I have the transaction working to the SOAP adapter receiver request / response. I see the correct approval response coming in my SOAP channel (RWB AE payload), but this message gets stuck there before routing back to my receiver interface and mappings.
    General setup:
    FILE Sender to SYNC OB SI.
    OB SI Request is my source message type and Response is my final message output type.
    OM Source is this Sync OB SI. Target is a SOAP Sync IB SI. Request Mapping program matches the source file message type and target SOAP layout. Response Mapping matches SOAP response and Target is my final file layout.
    Routing for Sync OB SI ID uses this OM for Sync IB SI.
    SYNC IB SI has Request and REsponse messages mapping the external SOAP call.
    When I test the configuration I get success.
    When I send messages through I get error in the adapter about this NO_BACK_SYSTEM_IN_HOPLIST (therefore the response message is not making it back into the IE so that it can be mapped again and forwarded).
    Complete error message from RWB Adapter Log "Transmitting the message to endpoint http://[myhostname]:[myport]/sap/xi/engine?type=entry using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: NO_BACK_SYSTEM_IN_HOPLIST:." and the next line is "Received XI System Error. ErrorCode: NO_BACK_SYSTEM_IN_HOPLIST ErrorText: null ErrorStack: Legacy system to which acknowledgment message is to be sent is missing in hoplist (with wasread=false)"
    Any ideas for me? (fyi not using BPM).
    Regards, Aaron Myers

    Hi AAron,
    Looks like this problem has occured before. There are SAP Notes recommended. Below are some helpful links.
    http://scn.sap.com/thread/848913
    http://scn.sap.com/message/4659941#4659941
    Thanks,
    Divya.

  • Noob Needs Help with File Size

    I created a simple form with no graphics, fonts are not embedded, and I selected the file to be filled out, printed, then mailed. The file size is 21MB. The form is to be emailed so it must be much smaller in size. Once received, the user will fill it out electronicly, print the form, then mail it back to me regular postal mail. Why is the file size so large and how can I make it smaller? Thanks in advance.
    Kevin

    OK. Here's what I did:
    1. At the welcome screen I selected "New Form" and then "New Blank Form"
    2. For the page size I left it at "Default" which is 8.5 x 11.
    3. For Return Method I selected "Fill then Print".
    4. At the last screen I just clicked "OK".
    5. Then I built the form. I put in (9) Text boxes, (4) Text Fields that look like Sunken Boxes, (5) Numeric Fields that look like Sunken Boxes, and (3) Check Boxes that look like Sunken Boxes.
    6. I then saved the file as a Static PDF Form File.
    7. The file size is 22.5 MB.
    That was my second attempt. The first attempt I had the fonts embedded and I had a Logo on the form. The file size for that one was 27.3 MB.
    Thanks for the help.
    Kevin

  • I need help with Variable Manipulation

    I've been searching on google for over an hour and a half to find Variable manipulation. It seems either you know how to do it or you don't. I'm trying to do 3 things:
    I want a text box in which I enter text and it manipulates a variable so that when I press enter, the variable becomes that text.
    I want to be able to at the click of a button either assign a variable or add to that variable, whether it be incrementing or adding larger numbers.
    Finally, I want to be able to reveal those variable either at the click of a button or when the frame of the scene I'm making starts.
    Could someone please explain to me either how to do it or where to look so I can teach myself?

    Ok...after creating what you are looking for I think your confusion may be in global variables initialization with Director vs other languages.   Within Director it is necessary to reintialize the global variable within each script you need to access it in.
    So what I have done is create a two slide movie...for lack of better names slide 1 and slide 2.
    Step 1:  create the PrepareMovie Script - this script preloads the field (text box) with  "type your name".  In this case I just assigned "type your name" to the playerName global varialble.
    On prepareMovie
      global playerName
      playerName="type your name"
      member("fName").text=playerName
    end
    Step 2:
    Place cast members into slide 1
    your name - text cast member
    fname - field cast member
    continue - sprite button
    Step 3:
    Place cast members into slide 2
    verify - text cast member
    recall - sprite button
    reveal - text cast member
    Result should look something like this in the score:
    Step 4:  Scripts
    Script 6 is nothing more than a "go to the frame" script to keep the play head in place.
    on exitFrame me
      go to the frame
    end
    Script 7 just under the Slider 2 Marker
    on prepareframe me
      global playerName
      member("verify").text="Just to be certain your name is " & playerName
    end
    The Continue Button Script - attach this to the button as button script
    on mouseUp
      global playerName
      ---stuff within the field box
      playerName=member("fname").text
      go to next
    end
    The Reveal Button Script
    on mouseUp me
      global playerName
      member("revealname").text=playerName
    end
    Thats it really....if its your first time using global variables inside director it can be a bit confusing if you are used to other programming languages.
    Good luck

  • I need help with File Object in Java

    Hello Experts.
    I am learning Java 2 now. I have trouble with reading a JTextField and save it to a file. I have some errors that I dont know what they are. I would like someone please help me to write a short sample program to see how it work. The code from the book I have dont execute at all. And I want to use FileOutputStream and ObjectOutputStream. Thank you very much
    Quoc

    import java.io.*;
    public class FileTest {
      public static void main(String[] arg) throws Exception{
        FileOutputStream fileOut = new FileOutputStream("test.txt");
        fileOut.write("Test file".getBytes());
        fileOut.close();

  • Noob needs help with array manipulation

    First off, I'd like to say hello to eveybody!
    I'm trying to figure out how to search for a value in an array, delete the first occurence of it, and shift the rest of the array down one. Can anyone point me in the right direction of an algorithm, mabey?
    Any help is most appreciated!

    first of all, let me comment that for this purpouse, you're better using the ArrayList class.
    anyway, you would need to make a temporary array inside a method, and traverse the array in question using a loop. most people use a for loop.
    Then, put all the values of the old array into the temporary one, except for the one you dont want.
    after the loop, set the old array to equal the temporary array.

  • Two PC's Connected to WRT54G -Need Help With File Sharing Folder

    Hi,
    I have both PC's connected to the WRT54G with internet access on.  How do I create file sharing and or a folder named "shared" on each desktop that allows each PC to drop files in this folder so that each PC can open and access those files?
    Jerry

    For File and Printer Sharing follow this link

  • Need help with File Share Subscription in SSRS 2008

    Hi,
         I have a requirement where  I have to deliver a SSRS report in csv format to a windows shared location. I know how to create a File Share Subscription to get this done, but the problem arises with the frequency of the report
    requested. It is like following..at 23:00, 23:30, 23:35, 23:40, 23:45, 23:50, 23:55, 24:00, 00:10, 00:20, 00:30, 03:00, 06:00, 09:00, 12:00, 15:00, 18:00, 21:00
    Now because the hourly pattern is not in a periodic format I am not able to get this scheduled in a single subscription. To achieve this one approach could creating multiple subscription. But I was wondering
    if there is a way to pass on the schedule information programmatically to a subscription, so that I can achieve this by creating just one subscription.
    Any expert ideas...

    Hi Mtiwari,
    Generally, we cannot create such an irregular execution time schedule. However, we can insert the execution time into a table and customize the steps on the job as a workaround. I have tested it on my local environment, the steps below are for your
    reference.
    Create a table and add the execution time to it using the query below.
    Use TestDB
    Create table [CustomeSchedule]([ExecuteTime]    Date)
    Insert into [CustomeSchedule]
    values('23:00'),('23:30'),('23:35'),('23:40'),('23:45'),('23:50'),('23:55'),('24:00'),('00:10'),('00:30'),('03:00'),('06:00'),('09:00'),('12:00'),('15:00'),('18:00'),('21:00')
    Create a subscription to execute erery Minute.
    Connect to SSMS>expand SQL Server Agent>expand Jobs, double-click the Jop.
    Select Steps on the left pane on the Job Properties window.
    Click Edit button and then use the query for on the command.
    IF exists(SELECT [ExecuteTime]FROM [TestDB].[dbo].[CustomeSchedule3] WHERE
    LEFT([ExecuteTime],5)=LEFT(CONVERT (time, SYSDATETIME()),5))
    BEGIN
    exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='9be28f07-3784-4070-802a-b7ca0aec4c7c'
    END
    Change the @EventType and @EventData to the values in your Job.
    If you have any questions, please feel free to ask.
    Regards,
    Charlie Liao
    Charlie Liao
    TechNet Community Support

  • Need help with File Sharing and iPHOTO Library sharing........

    I recently upgraded my imac and my macbook pro to Mavericks.
    I have some problems now.
    Previously using iPHOTO when running I was able to see the other computers iphoto library on the left side bar.  I was able then to access the other computers iphoto library.  This is no longer showing the other computers library from either computer.
    When I try to access the other computers files using file sharing I get a message that permisions are missing.
    It then asks if I want to fix permisions ,  I say yes....it will run for an hour and do nothing...I need to force quit.
    I really dont want to use the cloud to do this sharing....why should I upload into the internet when I have the computers on same network.
    Is there any place I can go to find how this is now done?  Before I didnt need to look up a thing....was just intuitive .  Now Im running into walls every way I try to share the iphoto libraries across computers.

    The iPhoto sharing that was in the previous version doesn't seem to exist. There is now iCloud Photo Sharing.
    http://support.apple.com/kb/HT5902
    I don't know about the file sharing issue.

  • I need help with File IO

    Does anyone know the most recent/logical way to transfer a .log (text) file from a server to a client? I've read that if you're reading and writing text files you should use FileRead, FileWriter. Yet other sources show that FileInputStream, FileOutputStream will work. I just want to be sure I'm using the most practical and up-to-date methods. Any advice would be appreciated. This is what I have so far....
    Server Code:
    import java.io.*;
    import java.io.IOException;
    public class Transfer
    public static void main(String[] args)
         try
              FileOutputStream output = new FileOutputStream("c:/iqyy.log");
              DataOutputStream data_output = new DataOutputStream (output);
    data_output.writeChars(String);
              data_output.flush();
         catch (IOException e)
    System.out.println("The following error occurred: "+e.toString());
    Client Code:
    import java.io.*;
    import java.io.IOException;
    public class Transfer
    public static void main(String[] args)
         try
              FileInputStream input = new FileInputStream ("c:/iqyy.log");
              DataInputStream data_input = new DataInputStream(input);     
    data_input.readLine();
              data_input.close();
         catch (IOException e)
    System.out.println("The following error occurred: "+e.toString());
         System.out.println("Transfer Complete");
    }

    Hi! Have you considered using FTP? I believe that if you run a search for FTP on these fora, you will find several matches. I think you can also download the necessary code from the O'reilly site (http://www.oreilly.com), although I am not absolutely positive.
    Hope this helps!
    Cheers!

  • New to After Effects - need help with text manipulation!

    Hi all, I'm new to AE and this forum and I'm looking for some advice. I've been asked by the boss at work to create a short video clip, around 10-15 seconds, where text is displayed on the screen (3 words), after the few seconds, I want a 'forging' noise to happen and the final word in the text to be changed to another word and have a metallic effect applied, similar to the effect in this tutorial:
    Create Hot Metallic Text in After Effects - After Effects - macProVideo.com Hub
    Will this be difficult to do and do you guys think a complete beginner like myself can do it? I've got a lot of experience with the likes of PS, so I'm not too shy with Adobe software.
    Thanks,
    John

    johnster1991 wrote:
    Thanks for the advice, I appreciate it. So will it be difficult to have one word of text come onto the screen and overlay on top of the existing text, as if it's crashing over it? Any ideas on the steps I would use to do this? Thanks
    As you begin your career of using AE, you will change your vocabulary. Overlay will be replaced with spatial references like in front or behind.
    Designing text with surface styles like chrome or metal is not difficult. You can even import them from Photoshop if you have some PS chops or friends who can do it quickly.
    TEXT ONE can be easily replaced with TEXT TWO in any of dozens of different ways but to drop TWO in front of ONE is easy, you're just setting position keyframes. The finesse of animation, though, lies in the illusion of motion, exaggeration, overshooting and recoil. Your TWO could fall and squish and rebound and bounce or it could raise a dust cloud as it hits or it could make the camera wiggle. These are the things that separate simple key framing from animation and motion graphics.

  • Need Help with file size

    How do you reduce pdf size file when it's save? I can have a excel spreadsheet that is 67KB and when I save it as pdf file increases to 289KB?

    I agree that the file size is not a big issue at 289kB. However, a lot of the size depends on the content and the job settings that have been used. It is a good practice in PDFs to embed the fonts and that may be what is causing the size increased in your PDF. You can use PDF Optimize (under the Save As menu in AAX) to access the audit function and find out what is causing the size issue. As mentioned, for the file at hand it is not much of an issue, but may be for future projects.

Maybe you are looking for