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.

Similar Messages

  • 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.

  • 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 adobe audtion recording using a mic i wantto plug in

    i need to record audio into adobe audtion using an external mic that i will plug intgo the mac. But whe i plug in the chord i still geth thw internal mic recording..any help please??????????????@

    I'll stress that I use Windows not a Mac so I'm not expert on that sort of thing but this guide seems to give the information you need:  How to Setup External Microphone in Mac - Make Tech Easier
    Once you have the computer itself set up, the controls you need within Audition are on the Edt/Preferences/Audio Hardware menu.  If the mic is properly recognised by the Mac operating system as per the link above, you should then find it on a drop down menu you can select from in Audition.

  • Need help with PMS matching

    I do large format printing and wholesale out to other print shops, but one of my customers sends EPS files designed in Flexisign and when they want a PMS match, the CMYK values are way off. I can look the swatch up on my Pantone bridge and type in the CMYK values or select the solid to process color palette to get the correct color, but it can be confusing at times.
    Is there an easy way to have values match when customers send work that has been designed by other programs?
    When I compare my Illustrator solid to process color palette to my Pantone color bridgeit will be close on the CMYK values and print almost exact. When the work comes in designed with Flexisignthe values are so far offpurple prints as gray and so forth. If I set up a new file and select the PMS colors and add them to my swatch library, and copy and paste the artwork from the Flexisign design, it gives a message that there is a conflict with a swatch and lets my correct the problem, but if its a complex design with many different PMS colors, it can be a pain. Any easy work around would be appreciated.
    Mark

    If working with CS3 or CS4 you can go to Edit>Edit Color>ReColor Art, you first select all your art.
    When the Live Color dialog opens you will be on the assign color section which will allow you to go from one color to another and access the Color Picker where you can then access the Color book swatches. You only have to select the art once and all the colors can be changed.
    Or you can go to the swatch icon near the bottom of Live Color document and choose the from the drop down the color book model you want, like PMS Solid Coated and all the colors will now show up as the spot equivalent.
    You can then if you like switch to the edit color and adjust the colors visually one at a time or link the colors and see if you adjust one while linked and if that will adjust all the others in sync.
    The Live Color feature will make this a lot less painful and may even make it a snap like a two or three second deal depending on how the colors have shifted.
    If you have problems understanding the interface I will do a small movie and post it. I have one already for changing colors in a gradient.
    Updated: in either case case you should select global as your setting.

  • 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 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!

  • 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();

  • 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.

  • 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

  • Need help with iTunes match on my iPhone 6. No longer syncing music as before on my iPhone 5.

    since purchasing my iPhone 6, i'm no longer able to play my music via iTunes match. i had no problems before playing off all my devices.

    Try posting in the iTunes Match forum, you'll probably find more knowledgeable folks there.
    https://discussions.apple.com/community/itunes/itunes_match

  • 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

  • Weblogic 10.0 and Log4j classpath problem

    My applications were working fine in WLS 9 but when I upgaded to WLS 10 I started getting log4j configuration and resource finding errors. Basically, if I do a "Logger.class.getClassLoader().getResourceAsStream(file)" I get a null pointer excep. bec.

  • Measurements of components

    Hello, I am almost finished with a large Flex 2.01 project and wanted to see if there would be any problems with the Application porting to Flex 3 plus I wouldn't mind trying out some of the cool features that were implemented. After installing Flex

  • Versions not saved when using iDisk??

    Right now I am unable to save a document with versions when I am saving it to my iDisk.  Is this not supposed to work with iDisk??  When I save the document to my desktop I can go back and see all the versions.  However when I move that same document

  • My iPod being a piece of...

    2nd time posting this. I need an answer and solution!!! I have had my mini for almost a year now and for the last month it's beenacting up. I admit to accidentally dropping it a few times but nothing ever happened until like 2 day later. I was listen

  • Adobe Dreamweaver CS4 do not load

    Hello, (sorry for my bad english) I have a problem, I downloaded the Trial-Version of Adobe Dreamweaver for 30 days. I installed it, but when I will start it, it comes 3 - 4 seconds long this window then it closes! http://img3.imagebanana.com/view/ui