Excel data filtration using oledb from huge excel files size approx (200mb) using c# (ADO)

hi,
My ado application requires to read data from one xlsx file(Approx 10-20MB min) and then process the data row by row and compare with
another xlsx file( approx size 250 MB min) containing over 1000000 rows with 63 columns (work like database).
when i try to read the database file (250 MB) and run the oledb data queries on it, it's working so strange, its only give the first matched data from the database file. but if i opened that xlsx database file in office excel and then run my application
its return all matched data from the database file without changing any code.
i already checked my dataquery its working fine in server Explorer and returns the complete result.
this process also very time consuming ,
i already tried openxml sax mathod to resolve the performance issue as well, but its not worked too. even it takes more time compare to oledb to read the excel.
i also have two another issues in my application,
1. sometime oledb returns an exception 'System resource exceeded' and
2. some time return 'internal ole automation error' .
i also tried google to resolve these issue but i didn't find any solution for my problem.
is there any solution to resolve these issues?  please help me. any suggestion appreciated but please remember one thing i can't change any xlsx table format because i don't have rights, these xlsx files automatically generated by another tools by our
sourcing partners.
thanks.

Please see this.
http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx
Or, if you don't have SSIS, do Bulk Insert by looping through the files.  Let's say the files have something in common, like a date in the name of the file.  Simply run this SQL Server script . . . 
DECLARE @intFlag
INT
SET @intFlag
= 1
WHILE (@intFlag
<=48)
BEGIN
PRINT @intFlag
declare @fullpath1
varchar(1000)
select @fullpath1
= '''\\ftp\your_path\'
+ convert(varchar,
getdate()- @intFlag
, 112)
+ '_your_file.txt'''
declare @cmd1
nvarchar(1000)
select @cmd1
= 'bulk insert [dbo].[your_table] from '
+ @fullpath1 +
' with (FIELDTERMINATOR = ''\t'', FIRSTROW = 2, ROWTERMINATOR=''0x0a'')'
exec (@cmd1)
SET @intFlag
= @intFlag + 1
END
GO
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

Similar Messages

  • Microsoft excel cannot copy and paste from one excel doc to another one

    I have a user that is on a Windows 7 64-bit machine and he has to different instances of excel open and coping information from one excel file to the other one. He can do it once and then when he tries to do it again excel says, "Microsoft cannot Copy and
    Paste." 
    I have tried to repair the install, that worked for a few days.
    Tried uninstalling Office suite and then re-installing Office suite.
    I reformatted the computer and did a fresh install of windows 7 and Office suite and today it started again.
    I need to get a fix for this as soon as possible.

    Hi,
    As far as I know, if you have Skype installed in your computer, the clipboard will be influenced.
    Refer to the link:
    http://support.microsoft.com/kb/2697462
    And this issue has been resolved in an update version.
    http://www.skype.com/intl/en-us/get-skype/on-your-computer/click-to-call/windows/
    Jaynet Zhang
    TechNet Community Support

  • I have a document made up of separate PDF files which reside in a folder and are linked to each other via hyperlinks. Each pdf file is set to open with bookmarks displayed, however if I link from one PDF file to another and use the "Previous View" button

    I have a document made up of separate PDF files which reside in a folder and are linked to each other via hyperlinks. Each pdf file is set to open with bookmarks displayed, however if I link from one PDF file to another and use the "Previous View" button to navigate back to my starting point the bookmarks are replaced by "page thumbnails". Is there anyway to stop this from happening?

    Hi Pusman,
    While setting up the links, if you choose to open the file in a new window then you won't face this issue, then you can simply switch to the previous file and bookmark view will remain as it is.
    Does that helps with your query?
    Regards,
    Rahul

  • Use function from external Javascript file

    Hi All,
    Is it possible to use function from other javascript file. If possible then please post some example.
    Shonky

    As Harbs mentioned, you can use doScript().
    Maybe you can do something like this:
    First I created simple function in separate file and exported it JSXBIN
    function myAlert(myString){
        alert(myString);
    Then, I copied contents of that JSXBIN and put it into variable
    var securedFUNCTION = app.doScript("@JSXBIN@ES@[email protected]AffABC40BhAB0AzHjNjZiBjMjFjSjUDAC0EzAEByB");
    or
    var securedFUNC = eval("@JSXBIN@ES@[email protected]AffABC40BhAB0AzHjNjZiBjMjFjSjUDAC0EzAEByB");
    And simply called function
    myAlert('My test String');
    Also, you can use include external script with #include to call JSXBIN, but you need to wrap contents of JSXBIN file into doScript or eval().
    tomaxxi
    http://indisnip.wordpress.com/

  • Is there a file size limitation to using this service?

    I am working on a large PDF file (26 mb) and I need to re-size the original and mess with the margins. I don't beleive there is an easy way to do this in Adobe Acrobat 6.0 Pro. It sounds like I have to convert the file back to a Word document, do the adjustments there and then produce a new PDF. I have two questions:
    Is there a file size limitation to using this service?
    Will a PDF to Word doc. conversion mantain the format of the orginal PDF?
    Thanks
    Tim

    Good day Tim,
    There is a 100MB file size limitation for submitting files to the ExportPDF service.  As for the quality of the conversion, from our FAQ entitled Will Adobe ExportPDF convert both text and formatting information?:
    Adobe ExportPDF is capable of exporting high quality information, but the quality of your Word or Excel document depends on the quality of the PDF file you start with. For instance, if your PDF file was originally authored in Microsoft Word or Excel and converted to PDF using the PDFMaker functionality of Adobe Acrobat®, your PDF file contains a rich set of information that can be captured by Adobe ExportPDF. This includes relative positioning of tables, images, and even multi-column text, as well as page, paragraph, and font attributes.
    If your PDF file was originally authored using simpler PDF generation methods, such as “print to PDF” or “scan to PDF” options, Adobe ExportPDF will convert any recognizable text and then use sophisticated conversion intelligence to preserve as much of the page layout as possible.
    Please let us know if you have any other questions!
    Kind regards,
    David

  • Help needed in Loading excel data to staging table from OAF Page

    Hi All,
    We have a requirement from the client on loading of a excel sheet data into staging table using OAF page.
    We were able to load a CSV file into staging table via OAF. The approach we used is we created a item of style 'messageFileUpload', which would pick the CSV file from desktop and we wrote the logic on the controller to place the file into server and then sumit a concurrent program to load the data into the staging table.
    But client wants data from the excel file to be loaded into staging table. Is there any way(approach) by which we can convert the excel file data into .CSV file using OAF?
    Any help or pointers on this will be highly apperciated.
    Thanks,
    Chethana

    Hi,
    Read through this :
    Need to upload a CSV/Excel to a table in OAF page
    Thanks,
    Gaurav

  • Data Upload into SAP from Microsoft Excel

    Hi Guys: I created a function module from a BDC program and made it RFC enabled. When I execute this in SAP, it works fine and creates a customer. But when I try to trigger it from Excel, it gives me the error “Object Variable or With Block Variable not set”.  Please HELP!...
    Here is my VB code
    Option Explicit
    ' Declaration for the necessary objects
    Dim objBAPICortrol, objConnection, objCreateCustomer, objAcctGr, objCoCode, objReturn As Object
    Dim objSalesOrg, objDistCh, objDiv, objName, objStreet, objPostalCode, objCity, objRegion, objCountry As Object
    Dim objCountycode, objCityCode, objReconAcnt, objPaymentHist, objCustPrPro, objCustStGrp, objIncoTerms, objSDPayTerms, objAcntAssGrp, objTaxClass As Object
    Dim vLastRow, vRows As Integer
    Private Sub CommandButton2_Click()
    ' Create an Email in Outlook
    Application.Dialogs(xlDialogSendMail).Show
    End Sub
    Private Sub CommandButton3_Click()
    ' Getting the last filled Row in Column A
    vLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    ' Setting the necessary variables for R/3 connection
    Set objBAPICortrol = CreateObject("SAP.Functions")
    Set objConnection = objBAPICortrol.connection
    ' Establish a connection
    If objConnection.Logon(0, False) Then
        MsgBox "Connection Established"
    End If
    On Error Resume Next
    ' Assign the Parameters
    Set objCreateCustomer = objBAPICortrol.Add("Z_RFC_CUSTOMER_CREATE_XLS")
    Set objAcctGr = objCreateCustomer.Exports("KTOKD_005")
    Set objCoCode = objCreateCustomer.Exports("BUKRS_001")
    Set objSalesOrg = objCreateCustomer.Exports("VKORG_002")
    Set objDistCh = objCreateCustomer.Exports("VTWEG_003")
    Set objDiv = objCreateCustomer.Exports("SPART_004")
    Set objName = objCreateCustomer.Exports("NAME1_006")
    Set objStreet = objCreateCustomer.Exports("STRAS_007")
    'Set objHouseNumber = objCreateCustomer.Exports("House Number")
    Set objPostalCode = objCreateCustomer.Exports("PSTLZ_009")
    Set objCity = objCreateCustomer.Exports("ORT01_008")
    Set objRegion = objCreateCustomer.Exports("REGIO_011")
    Set objCountry = objCreateCustomer.Exports("LAND1_010")
    Set objCountycode = objCreateCustomer.Exports("COUNC_013")
    'Set objPhone = objCreateCustomer.Exports("Phone")
    'Set objContact = objCreateCustomer.Exports("Contact")
    'Set objFax = objCreateCustomer.Exports("Fax")
    'Set objEmail = objCreateCustomer.Exports("Email")
    'Set objDirections = objCreateCustomer.Exports("Directions")
    Set objCityCode = objCreateCustomer.Exports("CITYC_014")
    Set objReconAcnt = objCreateCustomer.Exports("AKONT_015")
    Set objPaymentHist = objCreateCustomer.Exports("XZVER_017")
    Set objCustPrPro = objCreateCustomer.Exports("KALKS_019")
    Set objCustStGrp = objCreateCustomer.Exports("VERSG_020")
    Set objIncoTerms = objCreateCustomer.Exports("INCO1_021")
    Set objSDPayTerms = objCreateCustomer.Exports("ZTERM_023")
    Set objAcntAssGrp = objCreateCustomer.Exports("KTGRD_024")
    Set objTaxClass = objCreateCustomer.Exports("TAXKD_01_025")
    ' Now looping through all values create customer
    ' The data begin row is set to 2
    For vRows = 2 To vLastRow
    ' Set the Parameter Values
    objAcctGr.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 1).Value
    objCoCode.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 2).Value
    objSalesOrg.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 3).Value
    objDistCh.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 4).Value
    objDiv.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 5).Value
    objName.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 6).Value
    objStreet.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 7).Value
    'objHouseNumber.value = ThisWorkbook.ActiveSheet.Cells(vRows, 8).Value
    objPostalCode.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 9).Value
    objCity.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 10).Value
    objRegion.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 11).Value
    objCountry.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 12).Value
    objCountycode.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 13).Value
    'objPhone.value = ThisWorkbook.ActiveSheet.Cells(vRows, 14).Value
    'objContact.value = ThisWorkbook.ActiveSheet.Cells(vRows, 15).Value
    'objFax.value = ThisWorkbook.ActiveSheet.Cells(vRows, 16).Value
    'objEmail.value = ThisWorkbook.ActiveSheet.Cells(vRows, 17).Value
    'objDirections.value = ThisWorkbook.ActiveSheet.Cells(vRows, 18).Value
    objCityCode.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 19).Value
    objReconAcnt.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 20).Value
    objPaymentHist.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 21).Value
    objCustPrPro.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 22).Value
    objCustStGrp.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 23).Value
    objIncoTerms.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 24).Value
    objSDPayTerms.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 25).Value
    objAcntAssGrp.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 26).Value
    objTaxClass.Value = ThisWorkbook.ActiveSheet.Cells(vRows, 27).Value
    ' Function call
    objCreateCustomer.call
    ' Get return parameters & display in excel
    Set objReturn = objCreateCustomer.Imports("RETURN")
    ActiveSheet.Cells((vLastRow + vRows), 1) = objReturn.Value("MESSAGE")
    ' Error handling
    If Err Then
        MsgBox Err.Description
    End If
    Next vRows
    End Sub

    Hello,
    Whatz impossible ??
    Yes you can export the data from excel to SAP using VBA, but you need to create fome RFC in SAP as well that will handle the data you will send.
    1. Create a RFC function in R/3 that will read a file from specific location and perform the respective transaction.
    2. Create your excel file with respective file format and call the RFC function in SAP passing the parameters as file name and other required details.
    3. SAP coding for RFC will be a single time activity and then onwads you can just create excel file for upload and use VBA code to initiate the RFC call.
    Hope this make some sence. Tell me if you have more queries.
    Regards,
    Vishal
    Reward points.. if helpful

  • Loading data into multiple tables from an excel

    Can we load data in to multiple tables at a time from an excel through Utilities? If yes how? Please help me
    Regards,
    Pallavi

    I would imagine that the utilities allow you to insert data from a spreadsheet into 1 and only 1 table.
    You may have to write your own custom data upload using External Tables and a PL/SQL procedure to insert data from 1 spreadsheet into more than 1 table.
    If you need any guidance on doing this let me know and I will happily point you in the right direction.
    Regards
    Duncan

  • Loading the data from a text file to a table using pl/sql

    Hi Experts,
    I want to load the data from a text (sample1.txt) file to a table using pl/sql
    I have used the below pl/sql code
    declare
    f utl_file.file_type;
    s varchar2(200);
    c number := 0;
    begin
    f := utl_file.fopen('TRY','sample1.txt','R');
    loop
    utl_file.get_line(f,s);
    insert into sampletable (a,b,c) values (s,s,s);
    c := c + 1;
    end loop;
    exception
    when NO_DATA_FOUND then
    utl_file.fclose(f);
    dbms_output.put_line('No. of rows inserted : ' || c);
    end;
    and my sample1.txt file looks like
    1
    2
    3
    The data is getting inserted, with below manner
    select * from sampletable;
    A     B     C
    1     1     1
    2     2     2
    3     3     3
    I want the data to get inserted as
    A     B     C
    1     2     3
    The text file that I have is having three lines, and each line's first value should go to each column
    Please help...
    Thanks

    declare
    f utl_file.file_type;
    s1 varchar2(200);
    s2 varchar2(200);
    s3 varchar2(200);
    c number := 0;
    begin
    f := utl_file.fopen('TRY','sample1.txt','R');
    utl_file.get_line(f,s1);
    utl_file.get_line(f,s2);
    utl_file.get_line(f,s3);
    insert into sampletable (a,b,c) values (s1,s2,s3);
    c := c + 1;
    utl_file.fclose(f);
    exception
    when NO_DATA_FOUND then
    if utl_file.is_open(f) then utl_file.fclose(f); ens if;
    dbms_output.put_line('No. of rows inserted : ' || c);
    end;SY.

  • How to input data into an arraylist from a text file?

    I am trying to take data from a text file and put that data into an arraylist. First here is the text file:
    [item1, 10, 125.0, item2, 10, 12.0, item3, 20, 158.0]
    3
    4530.0
    [item5, 65, 555.5, item4, 29, 689.0]
    2
    56088.5
    [item7, 84, 34.5, item6, 103, 0.5, item8, 85, 1.36]
    3
    3065.1The text between the [ ] is the output from my arraylists. I have three arraylists. The first [ ] belongs to arraylist A, the second to arraylist B, and the third to arraylist C. The format of the arraylists is this:
    <item name>,<# in stock>,<value of one item>
    The first number below the arraylists in the text file represents the number of items in the list. The second number below the arraylists represents the total value of the items in the arraylists.
    Here is the class file I have (yes, it does everything):
    import java.io.*;
    import java.util.Scanner;
    import java.util.ArrayList;
    public class Inventory extends Object
         public int toAdd = 0;
         private boolean done = false;               //Are we done yet?
         public String strItemName;                    //The name of the item type.
         public int intNumInStock;                    //The number in stock of that type.      
         public double dblValueOfOneItem;          //The value of one item.
        public String strNumberInStock;               
        public double dblTotalValueA;               //The total value of warehouse A.
        public double dblTotalValueB;               //The total value of warehouse B.
        public double dblTotalValueC;               //The total value of warehouse C.
        public int intWarehouseAItemCount;          //Counter for items in warehouse A.
        public int intWarehouseBItemCount;          //Counter for items in warehouse B.
        public int intWarehouseCItemCount;          //Counter for items in warehouse C.
         ArrayList warehouseAList = new ArrayList();     //Create the Warehouse A ArrayList.                                   
         ArrayList warehouseBList = new ArrayList(); //Create the Warehouse B arrayList.
         ArrayList warehouseCList = new ArrayList(); //Create the Warehouse C arrayList.
         /** Construct a new Inventory object. */
         public Inventory()
              super();
         /**Add items to the Warehouse A ArrayList.*/
         private void createWareHouseA()
              System.out.println("!" + toAdd + " item types will be added to warehouse A.");
              //Cast
              String strNumInStock = Integer.toString(intNumInStock);
              String strValueOfOneItem = Double.toString(dblValueOfOneItem);
              this.strNumberInStock = strNumInStock;
              System.out.println("!Initial size of warehouseAList :  " +
                                                                warehouseAList.size());
              //Add items to the array List
              warehouseAList.add(this.strItemName);
              warehouseAList.add(this.strNumberInStock);
              warehouseAList.add(this.dblValueOfOneItem);
              System.out.println("!size of arrayList after additions " + warehouseAList.size());
         /**Add items to the Warehouse B ArrayList.*/
         private void createWareHouseB()
              System.out.println("!" + toAdd + " item types will be added to warehouse B.");
              //Cast
              String strNumInStock = Integer.toString(intNumInStock);
              String strValueOfOneItem = Double.toString(dblValueOfOneItem);
              this.strNumberInStock = strNumInStock;
              System.out.println("!Initial size of warehouseBList :  " +
                                                                warehouseBList.size());
              //Add items to the array List
              warehouseBList.add(this.strItemName);
              warehouseBList.add(this.strNumberInStock);
              warehouseBList.add(this.dblValueOfOneItem);
              System.out.println("!size of arrayList after additions " + warehouseBList.size());
         /**Add items to the Warehouse C ArrayList.*/
         private void createWareHouseC()
              System.out.println("!" + toAdd + " item types will be added to warehouse C.");
              //Cast
              String strNumInStock = Integer.toString(intNumInStock);
              String strValueOfOneItem = Double.toString(dblValueOfOneItem);
              this.strNumberInStock = strNumInStock;
              System.out.println("!Initial size of warehouseCList :  " +
                                                                warehouseCList.size());
              //Add items to the array List
              warehouseCList.add(this.strItemName);
              warehouseCList.add(this.strNumberInStock);
              warehouseCList.add(this.dblValueOfOneItem);
              System.out.println("!size of arrayList after additions " + warehouseCList.size());
         /**Interpret the commands entered by the user.*/
         public void cmdInterpreter()
              this.displayHelp();
              Scanner cin = new Scanner(System.in);
              while (!this.done)
                   System.out.print(">");
                   //"line" equals the next line of input.
                   String line = cin.nextLine();
                   this.executeCmd(line);
         /**Execute one line entered by the user.
          * @param cmdLN; The command entered by the user to execute. */
          private void executeCmd(String cmdLN)
               Scanner line = new Scanner(cmdLN);
               if (line.hasNext())
                    String cmd = line.next();
                    //What to do when users enter the various commands below.
                    if (cmd.equals("help"))
                         this.displayHelp();
                    else if (cmd.equals("Q!"))
                         this.done = true;
                    else if (cmd.equals("F") && line.hasNext())
                         this.inputFromFile(line.next());
                    else if (cmd.equals("K") && line.hasNext())
                         int numItemsToAdd = Integer.valueOf( line.next() ).intValue();
                         this.toAdd = numItemsToAdd;
                         this.inputFromKeyboard(numItemsToAdd);
          /**What to do if input comes from a file.
           *     @param inputFile; The name of the input file to process.*/
          private void inputFromFile(String inputFile)
               Scanner cin = new Scanner(System.in);
               System.out.println("!Using input file " + inputFile + ".");
               System.out.print("!Enter the name of the output file: ");
               String outputFile = cin.next();
               System.out.println("!Using output file " + outputFile + ".");
              try
                   BufferedReader in = new BufferedReader(new FileReader(inputFile));
                   //Scanner in = new Scanner(new File(inputFile));
                   //Initialize the String variables.
                   String line1 = null;
                   String line2 = null;
                   String line3 = null;
                   String line4 = null;
                   String line5 = null;
                   String line6 = null;
                   String line7 = null;
                   String line8 = null;
                   String line9 = null;
                   System.out.println(in.equals(",") + " see?");
                   //System.out.println((char)(char)in.read() + " experiment");
                   /**This loop assigns values to the string variables based on the
                    * values on each line in the input file. */
                   while(in.readLine() != null)
                        line1 = in.readLine();
                        line2 = in.readLine();
                        line3 = in.readLine();
                        line4 = in.readLine();
                        line5 = in.readLine();
                        line6 = in.readLine();
                        line7 = in.readLine();
                        line8 = in.readLine();
                        line9 = in.readLine();
                   //Print the contents of each line in the input file.
                   System.out.println("!value of line 1: " + line1);
                   System.out.println("!value of line 2: " + line2);
                   System.out.println("!value of line 3: " + line3);
                   System.out.println("!value of line 4: " + line4);
                   System.out.println("!value of line 5: " + line5);
                   System.out.println("!value of line 6: " + line6);
                   System.out.println("!value of line 7: " + line7);
                   System.out.println("!value of line 8: " + line8);
                   System.out.println("!value of line 9: " + line9);
                /**Add items to the warehouses.*/
                   warehouseAList.add(line1);
                   warehouseBList.add(line4);
                   warehouseCList.add(line7);
                /**Add the item count and total value for warehouse A.*/
                   int intLine2 = Integer.valueOf(line2).intValue();
                   this.intWarehouseAItemCount = intLine2;
                   double dblLine3 = Double.valueOf(line3).doubleValue();
                   this.dblTotalValueA = dblLine3;
                /**Add the item count and total value for warehouse B.*/
                   int intLine5 = Integer.valueOf(line5).intValue();
                   this.intWarehouseBItemCount = intLine5;
                   double dblLine6 = Double.valueOf(line6).doubleValue();
                   this.dblTotalValueB = dblLine6;
                /**Add the item count and total value for warehouse C.*/
                  int intLine8 = Integer.valueOf(line8).intValue();
                  this.intWarehouseCItemCount = intLine8;
                  double dblLine9 = Double.valueOf(line9).doubleValue();
                  this.dblTotalValueC = dblLine9;
                /**Ask the user how many items to add or delete from inventory.*/
                  System.out.print("Enter the number to add to inventory for " +
                                                               warehouseAList.get(0) + ":");
                  String toAddOrDel = cin.next();
                /**Print the contents of all the warehouses. */
                   System.out.println(" ");
                   //Print the contents of warehouse A.
                   System.out.println("!--------------------------------");
                   System.out.println("!----------Warehouse A:----------");
                   System.out.println("!--------------------------------");
                   //Print the item list for warehouse A.
                   System.out.println(warehouseAList);
                   //Print the total amount of items in warehouse A.
                   System.out.println("Total items: " + this.intWarehouseAItemCount);
                   //Print the total value of the items in warehouse A.
                   System.out.println("Total value: " + this.dblTotalValueA);
                   System.out.println("!--------------------------------");
                   System.out.println("!----------Warehouse B:----------");
                   System.out.println("!--------------------------------");
                   //Print the item list for warehouse B.
                   System.out.println("!warehouseB: " + warehouseBList);
                   //Print the total amount of items in warehouse B.
                   System.out.println("Total items: " + this.intWarehouseBItemCount);
                   //Print the total value of the items in warehouse B.
                   System.out.println("Total value: " + this.dblTotalValueB);
                   System.out.println("!--------------------------------");
                   System.out.println("!----------Warehouse C:----------");
                   System.out.println("!--------------------------------");
                   //Print the item list for warehouse C.
                   System.out.println("!warehouseC: " + warehouseCList);
                   //Print the total amount of items in warehouse C.
                   System.out.println("Total items: " + this.intWarehouseCItemCount);
                   //Print the total value of the items in warehouse C.
                   System.out.println("Total value: " + this.dblTotalValueC);
                   in.close();
              catch (FileNotFoundException e)
                   System.out.println("!Error: Unable to open file for reading.");
              catch (EOFException e)
                   System.out.println("!Error: EOF encountered, file may be corrupted.");
              catch (IOException e)
                   System.out.println("!Error: Cannot read from file.");
          /**What to do if input comes from the keyboard.
           *     @param numItems; The total number of items that will be added to the
           *                      Warehouse(s). */
          public void inputFromKeyboard(int numItems)
               System.out.println("!You will be adding " + numItems + " items to " +
                                             "inventory from the keyboard. ");
               this.toAdd = numItems;
               Scanner cin = new Scanner(System.in);
               //Prompt user for name of output file.
               System.out.print("!Enter the name of the output file: ");
               String outputFile = cin.next();
               /**This loop asks the user for information about the item(s) and inputs
                 *them into the appropriate array.*/
               int count = 0;
               while (numItems > count)
                    //Item name.
                    System.out.print("!Item name: ");
                    String addItemName = cin.next();
                    //Number in stock.
                    System.out.print("!Number in stock: ");
                    String addNumInStock = cin.next();
                    //Initial warehouse.
                    System.out.print("!Initial warehouse(A,B,C): ");
                    String addInitWarehouse = cin.next();
                    //Value of one item.
                    System.out.print("!Value of one item: ");
                    String addValueOfOneItem = cin.next();
                    //Add or delete from inventory
                    System.out.print("!Enter amount to add or delete from inventory: ");
                    String strAddOrDelete = cin.next();
                    System.out.println("!Amount to add or delete: " + strAddOrDelete);
                    //Cast
                    int intAddNumInStock = Integer.valueOf(addNumInStock).intValue();
                    double doubleAddValueOfOneItem = Double.valueOf(addValueOfOneItem).doubleValue();
                    int intAddOrDelete = Integer.valueOf(strAddOrDelete).intValue();
                    /**Add intAddNumInStock with intAddOrDelete to determine the amount
                     * to add or delete from inventory (If a user wishes to remove items
                     * from inventory simply add negative values). */
                    intAddNumInStock = intAddNumInStock + intAddOrDelete;
                    System.out.println("!Inventory after modifications: " + strAddOrDelete);
                    this.strItemName = addItemName;
                    this.intNumInStock = intAddNumInStock;
                    this.dblValueOfOneItem = doubleAddValueOfOneItem;
                    //Put items into warehouse A if appropriate.
                    if (intAddNumInStock < 25)
                        //Increment the warehouse A item count.
                        this.intWarehouseAItemCount = this.intWarehouseAItemCount + 1;
                        //Calculate the total value of warehouse A.
                        this.dblTotalValueA = this.dblTotalValueA + intAddNumInStock * doubleAddValueOfOneItem;
                        //Create the warehouse A array list.
                        this.createWareHouseA();
                    //Put items into warehouse B if appropriate.
                    if (intAddNumInStock >= 25)
                        if (intAddNumInStock < 75)
                             //Increment the warehouse B item count.
                             this.intWarehouseBItemCount = this.intWarehouseBItemCount + 1;
                             //Calculate the total value of warehouse B.
                             this.dblTotalValueB = this.dblTotalValueB + intAddNumInStock * doubleAddValueOfOneItem;
                             //Create the warehouse B array list.
                             this.createWareHouseB();
                    //Put items into warehouse C if appropriate.
                    if (intAddNumInStock >= 75)
                        //Increment the warehouse C item count.
                        this.intWarehouseCItemCount = this.intWarehouseCItemCount + 1;
                        //Calculate the total value of warehouse C.
                        this.dblTotalValueC = this.dblTotalValueC + intAddNumInStock * doubleAddValueOfOneItem;
                        //Create the warehouse C array list.
                        this.createWareHouseC();
                     //display helpful information.      
                    System.out.println("!--------------------------------");
                    System.out.println("!" + addItemName + " is the item name.");
                    System.out.println("!" + addNumInStock + " is the number in stock.");
                    System.out.println("!" + addInitWarehouse + " is the initial warehouse.");
                    System.out.println("!" + addValueOfOneItem + " is the value of one item.");
                    System.out.println("!--------------------------------------------------");
                   //Increment the counters.
                    count++;
               /**Create and write to the output file. */
               try
                     //Use the output file specified by the user.
                    PrintWriter out = new PrintWriter(outputFile);
                 /**Write warehouse A details.*/
                      //Blank the first line.
                      out.println(" ");
                    //Write the array list for warehouse A.
                    out.println(warehouseAList);
                    //Write the amount of items in warehouse A.
                    out.println(intWarehouseAItemCount);
                    //Write the total value for warehouse A.
                    out.println(dblTotalValueA);
                 /**Write warehosue B details.*/
                   //Write the array list for warehouse B.
                    out.println(warehouseBList);
                    //Write the amount of items in warehouse B.
                    out.println(intWarehouseBItemCount);
                    //Write the total value for warehouse B.
                    out.println(dblTotalValueB);
                 /**Write warehouse C details.*/
                      //Write the array list for warehouse C.
                    out.println(warehouseCList);
                    //Write the amount of items in warehouse C.
                    out.println(intWarehouseCItemCount);
                    //Write the total value for warehouse C.
                    out.println(dblTotalValueC);
                    //Close the output file.
                    out.close();     
                catch (FileNotFoundException e)
                   System.out.println("Error: Unable to open file for reading.");
               catch (IOException e)
                   System.out.println("Error: Cannot read from file.");
               /**View the contents and the value of each warehouse.*/
               System.out.println("!---------------Inventory Summary------------------");
               System.out.println("!--------------------------------------------------");
               System.out.println("!--------------------LEGEND:-----------------------");
               System.out.println("!<item type>, <amount in stock>,<value of one item>");
               System.out.println("!--------------------------------------------------");
               System.out.println("!------------------Warehouse A:--------------------");
               System.out.println("!--------------------------------------------------");
               //Display Items in warehouse A.
               System.out.println(warehouseAList);
               //Total items in warehouse A.
               System.out.println("Total items: " + intWarehouseAItemCount);
               //Display total value of warehouse A.
               System.out.println("Total value: " + "$" + dblTotalValueA);
               System.out.println("!--------------------------------------------------");
               System.out.println("!------------------Warehouse B:--------------------");
               System.out.println("!--------------------------------------------------");
               //Display Items in warehouse B.
               System.out.println(warehouseBList);
               //Total items in warehouse B.
               System.out.println("Total items: " + intWarehouseBItemCount);
               //Display total value of warehouse B.
               System.out.println("Total value: " + "$" + dblTotalValueB);
               System.out.println("!--------------------------------------------------");
               System.out.println("!------------------Warehouse C:--------------------");
               System.out.println("!--------------------------------------------------");
               //Display Items in warehouse C.
               System.out.println(warehouseCList);
               //Total items in warehouse C.
               System.out.println("Total items: " + intWarehouseCItemCount);
               //Display total value of warehouse C.
               System.out.println("Total value: " + "$" + dblTotalValueC);
         /**Display a help message.*/
         private void displayHelp()
              System.out.println("!--------------------------------");
              System.out.println("! General Help:");
              System.out.println("!--------------------------------");
              System.out.println("! ");
              System.out.println("!'help' display this help message.");
              System.out.println("!'Q!' quit this program.");
              System.out.println("!--------------------------------");
              System.out.println("! Input File Specific Commands:");
              System.out.println("!--------------------------------");
              System.out.println("! ");
              System.out.println("!'F' <name> type F followed by the name of the " +
                                       "file to be used for input.");
              System.out.println("!---------------------------------------");
              System.out.println("! Input From Keyboard Specific Commands:");
              System.out.println("!---------------------------------------");
              System.out.println("! ");
              System.out.println("!'K' <number> type K followed by the number of " +
                                        "items that will be added. ");
              System.out.println("! ");
    }Program file:
    public class InventoryProg
         public static void main(String[] args)
              //Create a new Inventory object.
              Inventory test = new Inventory();
              //Execute the command interpreter.
              test.cmdInterpreter();
    }Right now I am stuck on this and I cannot progress any further until I figure out how to input the data in the text file back into a arraylist.
    Thanks in advance.

    Thanks but I figured it out. Heres a sample of the code i used to solve my problem:
    try
                           //Warehouse A BufferedReader.
                   BufferedReader inA = new BufferedReader(new FileReader(inputFileWarehouseA));
                   //Warehouse B BufferedReader.
                   BufferedReader inB = new BufferedReader(new FileReader(inputFileWarehouseB));
                   //Warehouse C BufferedReader.
                   BufferedReader inC = new BufferedReader(new FileReader(inputFileWarehouseC));
                   //Warehouse details BufferedReader.
                   BufferedReader inDetails = new BufferedReader(new FileReader(inputFileDetails));
                   //Will hold values in warehouse arraylists.
                   String lineA = null;
                   String lineB = null;
                   String lineC = null;
                   //Will hold the details of each warehouse.
                   String line1 = null;
                   String line2 = null;
                   String line3 = null;
                   String line4 = null;
                   String line5 = null;
                   String line6 = null;
                   //Get the item count and total value for each warehouse.
                   while(inDetails.readLine() != null)
                        line1 = inDetails.readLine();
                        line2 = inDetails.readLine();
                        line3 = inDetails.readLine();
                        line4 = inDetails.readLine();
                        line5 = inDetails.readLine();
                        line6 = inDetails.readLine();
               /**Assign the item count and total value to warehouse A.*/
                  //Cast.
                   int intLine1 = Integer.valueOf(line1).intValue();
                   double dblLine2 = Double.valueOf(line2).doubleValue();
                   //Assign the values.
                   this.intWarehouseAItemCount = intLine1;
                   this.dblTotalValueA = dblLine2;
                /**Assign the item count and total value to warehouse B.*/
                     //Cast.
                   int intLine3 = Integer.valueOf(line3).intValue();
                   double dblLine4 = Double.valueOf(line4).doubleValue();
                     //Assign the values.
                   this.intWarehouseBItemCount = intLine3;
                   this.dblTotalValueB = dblLine4;
                /**Assign the item count and total value to warehouse C.*/
                     //Cast.
                     int intLine5 = Integer.valueOf(line5).intValue();
                   double dblLine6 = Double.valueOf(line6).doubleValue();
                   //Assign the values.
                   this.intWarehouseCItemCount = intLine5;
                   this.dblTotalValueC = dblLine6;
                /**Put the items back into the warehouses arraylists. */
                   //Add items to warehouse A.
                   while((lineA = inA.readLine()) != null)
                        warehouseAList.add(lineA);
                   //Add items to warehouse B.
                   while((lineB = inB.readLine()) != null)
                        warehouseBList.add(lineB);
                   //Add items to warehouse C.
                   while((lineC = inC.readLine()) != null)
                        warehouseCList.add(lineC);
                   }(this isn't the whole try statement its pretty long)

  • Error while loading  data into External table from the flat files

    HI ,
    We have a data load in our project which feeds the oracle external tables with the data from the Flat Files(.bcp files) in unix.
    While loading the data, we are encountering the following error.
    Error occured (Error Code : -29913 and Error Message : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: un) while loading data into table_ext
    Please let us know what needs to be done in this case to solve this problem.
    Thanks,
    Kartheek

    Kartheek,
    I used Google (mine still works).... please check those links:
    http://oraclequirks.blogspot.com/2008/07/ora-29400-data-cartridge-error.html
    http://jonathanlewis.wordpress.com/2011/02/15/ora-29913/
    HTH,
    Thierry

  • Huge HD file sizes in iMovie when importing AVCHD files from HD Camcorder

    Although several answers have been given on different ways to import HD files from a AVCHD camcorder, in this case a Sony one, the issue is what to do with the HUGE files it creates. I recorded 2 hours of HD content in about 30GB on the camcorder. I can burn those native HVCHD files on DVD's, took 6 of them, and play them on a Blue Ray player in HD. To edit, I tested a sample 50MB file that was about 3 minutes in length. It convered to quicktime file in the same 1920x1080 quality resulted in a file that was about 800MB, looked great, but how do I store or play a 20 minute version of it? iMovie is inadequate to do anything other than produce smaller size files for an iPod or lower quality, unless it is going to be a very short HD movie if doing true HD quality. One of the reasons I took the MAC plunge was the better multimedia capabilities. In this case, Apple (iMove and Final Cut) is behind.
    I ended up shifting my HD editing back to a PC with $100 Sony Vegas software that can edit the AVCHD files and author in it. I can produce a DVD with about 25 minutes of edited HD in AVCDH file format and play it. I can also store the finished product in a much smaller space using AVCHD files. I have a 1 TB drive on my Mac that would be consumed if I worked in iMovie with converting all these AVCDH files and kept them in HD quality since it looks like it needs to expand them 12-16 times the AVCHD file size.
    Yes, I know I could lower the quality to better work with them in iMovie, but that makes no sense to me. I want to record and edit in the HD format. Seems like these AVCHD cameras are becoming a standard since they are so efficient at storing HD content, iMovie needs to figure out how to edit and store them the same way. Very disappointed in how iMovie handles HD, to me it is NOT very good at handling HD, no good way to store or distribute it.
    Am I missing soomething here? I have spent hours looking for a different answer, but have not found one yet? Maybe the next version of iMovie will be better. I like using it for SD DVD authoring, but for HD, did not work at all for me.
    Jon

    Interesting you say it is not meant for editing, but there are about a half dozen editor's for windows that will work on these exact files. I know with Sony Vegas that I have the same level of control with frame precision as I do with iMovie so I think there must be more to the story why Apple has not been able to support it like other software manufacturers who support windows. Don't get me wrong, i would love to do the work in iMovie and not have to learn something new. I don't have the storage space to use the HD apple format, that 2 hr of HD in AVCHD would turn into about 500GB then what do I put it on to play it. If the BlueRay standard calls for 25 or 50G disc's and we can get full two hour movies on them today, then they must be using a file format similar to AVCHD to fit on a disc, they cannot be using anything close to what Apple uses for HD files, it is just simple logic and math. So why doesn't Apple finure it out before everyone who starts working in HD comes to the same conclusion that the Apple QT file formats for HD is going to be an issue with space, you can create content, but cannot afford the disc space to store it or play it.

  • Sliding Flash Interface - Using Links from an XML file Problem

    Hi All,
    Working on a new site for the company i've recently started
    working for... fairly new to flash but wanted to try this sliding
    interface for the graphic banner at the top of the page...
    have a look here at an early version of the site - sliding
    graphic interface at the top with coloured rollover buttons (a lot
    of work still to do! feel free to post constructive criticism)
    (am I allowed to post links??)
    here is the unfinished version with no links in the flash bit
    http://www.westfieldhealth.com/website/index.asp
    The Problem:
    I am pulling in a 'heading' 'text' and 'image' into the
    sliding graphic interface from the following xml file... (there are
    4 different xml files for 4 different slides)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <content>
    <dialogue>
    <heading>Interested in selling our health
    plans?</heading>
    <text>Click here to learn more...</text>
    <img>home_window/intSmall.jpg</img>
    </dialogue>
    </content>
    I want to add a link to the xml that would be specific to
    each instance of the window...
    eg
    <link>contact-us/index.asp</link>
    But my limited knowledge of flash means I have no idea how to
    pull the link through from the xml file to use in the flash...
    Perhaps I need link text to pull as well
    eg
    <link-text>click here to contact us</link-text>
    Here is the function that pulls in the img, heading and txt
    public function onComplete(event:Event):void {
    var loader:URLLoader = event.target as URLLoader;
    if (loader != null) {
    externalXML = new XML(loader.data);
    mover_mc.heading_txt.htmlText =
    externalXML.dialogue[0].heading;
    mover_mc.myText_txt.htmlText = externalXML.dialogue[0].text;
    var url:URLRequest = new
    URLRequest(externalXML.dialogue[0].img);
    myLoader.load(url);
    } else {
    trace("loader is not a URLLoader!");
    Can anyone help me on how to pull in the link from the xml
    and use it to navigate to a different page on the site
    Thanks very much
    Hans
    link to
    my unfinished flash file...

    What is the exact error you get (what db version also), could you post a simplified version of the SQL which fails also? I have splitter based maps that successfully read from file via the XMLType(bfilename....) style code and insert into multiple targets, I did this on 11g though.
    Cheers
    David

  • Is there a file size limit when using Read From Spreadsheet File?

    I'm trying to read in a large file, about 52mb, 525600 lines with 27 fileds in each line using "Read From SpreadsheetFile.vi". I then search the 2D array for -999, which represents bad/no data in that field and total the number of fields with -999 in it. This all works on 3 months worth of data. The program is giving me an out of memory error and stopping in the case where the read takes place on the large one year file. So my question is does the Read from Spreadsheet file have size limitations? Is there a better way to do this? Thanks in advance for the help.
    ssmith
    Solved!
    Go to Solution.

    Camerond--
           Thanks for the help. I recreated the VI you posted and unfortunately it doesnt work. It looks like the index array vi is only looking at the zero index and not the other 26 fields in each row. This would probably require a FOR LOOP to go through each field index. This is what I have and it works on a smaller version of the file. For some reason LV is using up bucket loads of memory to run this smaller file and crashes running the 60MB file. I've attached one of my vi's to solve this problem and the smaller data set. You'll see in the beginning that I trim some columns and rows to leave just the data I want to scan. Thanks again for the help.
        I just tried send 3 months worth of one minute data and it failed. So here is a really small version, 20 minutes worth of data. Does anyone see anything that would cause memory usage issues here?
    ssmith
    Attachments:
    Find-999NoLoops.vi ‏17 KB
    TEST2MET.txt ‏3 KB

  • No Video using Airplay from iPad 2 to Apple TV 2 using authorized App.

    I have an iPad 2 and Apple TV 2.   I use Slingbox.   
    Today, I started watching a show using my iPad as a Slingbox Player.   The source TV was in another state.   The video and audio was good, and the network speed using Speakeasy was above 3MBPS download.   I clicked on the Airplay button at the top, and the video and audio started playing on my HD TV in full HD.  Audio and Video were correct and great. 
    Then I tried to change channels and evenutally I disconnected the Slingbox.   I reconnected the Slingbox and after pushing the Airplay button again, I only got audio (with a little musical note symbol on the tv at the lower lest corner).   I then proceeded to reboot the iPad 2 and i reset the Apple TV to factory settings.   No luck.  Reconnecting via Airplay to the TV only will stream Audio.   The network speed stayed above 3MBPS. 
    I also was unable to connect video using my iPhone, but I was able with my MacBook Air. 
    Note:  I AM able to force mirroring by turning Mirroring "on" (double click on button, swipe app bar to the right, hit Airplay button, and turn on Mirroring).   But although the video is fine, I lose HD and the picture qualtiy is degraded.   Not a good solution.
    I now KNOW that I can send a Slingbox signal to my HDTV from my iPad as a Slingplayer and using Airplay.  It worked!  But only for about 20 minutes, and I am not able to get it back. 
    This is a real poser.   I hope someone knows how to fix this (but judging from the other questions on this question over the years - I doubt it...:-(

    I FOUND THE ANSWER TO MY OWN QUESTION:  The Slingplayer will tend to default to SQ (Standard Quality) playback.   Under "Quality" on the Slingplayer screen, there are choices of SQ, HD (High Def) and AUTO.   I selected "Auto" and it went to HD quality.  Then, when I enabled AirPlay, a full HD picture appeared on my TV WITHOUT having to select "Mirroring".   
    I get 10 points...

Maybe you are looking for

  • Error message when using search

    why do i keep getting an error message when using the "search" tabe in iTunes. This happend whe i upgraded t the latest version of itunes.

  • Final Cut Studio 2 not opening in OS 10.6.6

    As of today, my entire office of 7 MacPros will not open any of the FCS2 apps. The last time we updated anything was a couple of weeks ago. Is anyone else having this issue and does anyone have a solution?

  • Can't open attachments in Outlook Express since using recovery DVD

    I have a Toshiba Satellite laptop on Windows xp. I had to run the product recovery dvd-rom as it was really playing up switching it self off and all kinds well thats sorted now and is back to running normal. The only problem now is, when i try and op

  • Macbook won't install updates

    I'm trying to update my Macbook's software. There are various items found that need updating. It tells me the following messages: "To install the updates, you must restart your computer.      To finish the installation and restart your computer, clic

  • PO Workflow release

    Hi guys, i created release strategy. I have problem with PO WF configuration. In SPRO I assigned my SAP login to the release strategy. The problem is that when I create PO I do not receive new message in SBWP. As far as I know WF has been activated.