How can one  read a Excel File and Upload into Table using Pl/SQL Code.

How can one read a Excel File and Upload into Table using Pl/SQL Code.
1. Excel File is on My PC.
2. And I want to write a Stored Procedure or Package to do that.
3. DataBase is on Other Server. Client-Server Environment.
4. I am Using Toad or PlSql developer tool.

If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
1. Get your DBA to create directory object in oracle using the following command:
create directory TEST_DIR as ‘directory_path’;
Note: This directory is on the server.
2. Grant read,write on directory directory_object_name to username;
You can find out the directory_object_name value from dba_directories view if you are using the system user account.
3. Logon as the user as mentioned above.
Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
function getData(p_filename in varchar2,
p_filepath in varchar2
) RETURN VARCHAR2 is
input_file utl_file.file_type;
--declare a buffer to read text data
input_buffer varchar2(4000);
begin
--using the UTL_FILE in built package
input_file := utl_file.fopen(p_filepath, p_filename, 'R');
utl_file.get_line(input_file, input_buffer);
--debug
--dbms_output.put_line(input_buffer);
utl_file.fclose(input_file);
--return data
return input_buffer;
end;
Hope this helps.

Similar Messages

  • How can I read a Excel file?

    How can I read an Excel file and compare if the cells type are numeric or not??
    i hope you can can give me a hand..
    thanks

    If you want to use plsql try utl_file supplied package to read the excel file -> http://psoug.org/reference/utl_file.html
    And you can use a function like this to understand if the column is number or not ;
    CREATE OR REPLACE FUNCTION is_number (
    char_in VARCHAR2)
    RETURN BOOLEAN
    IS
    n NUMBER;
    BEGIN
    n := TO_NUMBER(char_in);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS THEN
    RETURN FALSE;
    END is_number;
    DECLARE
    x BOOLEAN;
    BEGIN
    IF is_number('ABC') THEN
    dbms_output.put_line('TRUE');
    ELSE
    dbms_output.put_line('FALSE');
    END IF;
    END;
    /

  • How can I read the EXCEL file while Program is running in background.

    Hi all Expert,
    How can I read the EXCEL file while Program is running in background.
    Thanks

    you need to place ur excel file on application server and follow this thread: Reading an Excel file from the application server?
    loots of information if you can search forum.. thanks

  • How can i read local excel file into internal table in webdynpro for abap a

    Could someone tell me how How can i read local excel file into an internal table in webdynpro for abap application.
    thank u for your reply

    Deep,
    File manuplations...............................
    1. At the presentation level:
    ->GUI_UPLOAD
    ->GUI_DOWNLOAD
    ->CL_GUI_FRONTEND
    2. At the application server level:
    ->OPEN DATASET : open a file in the application server for reading or writing.
    ->READ DATASET : used to read from a file on the application server that has been opened for reading
    -> TRANSFER DATASET : writing data to a file.
    -> CLOSE DATASET : closes the file
    -> DELETE DATASET : delete file
    If file is on the local PC,use the function module GUI_UPLOAD to upload it into an internal table by passing the given parameters......
    call function 'GUI_UPLOAD'
    exporting
    filename = p_file
    filetype = 'ASC'
    has_field_separator = '#'
    tables
    data_tab = t_data
    p_file : excel file path.
    t_data : internal table
    <b>reward points if useful.</b>
    regards,
    Vinod Samuel.

  • How can I read the bootstrap files and extract the fragment-URLs and fragment-numbers in plain text?

    How can I read the bootstrap files of any HDS Live stream and extract the fragment-URLs and fragment-numbers in plain text?
    Could it be that it is some kind of compressed format in the bootstrap? Can I uncompress it wirh  f4fpackager.exe? Could not find any download for f4fpackager.exe. I would prefere less code to do so. Is there something in Java of JavaScript, that can extract the fragment-numbers?
    Thank you!

    Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
    Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave.

  • How can I read an excel file .xls from an forms 6i

    Hi
    I have forms6i and webutil don t work with this version, can I read an excel file from forms6i.
    Thank u

    Hi hosoriol,
    You can refer an excel as an external table first using the steps below and then you can start reading from it.
    If you want to update the excel file then create an view and create instead of triggers for it.
    Steps
    h3. 1.[Create an external table for the excel file |http://www.adp-gmbh.ch/ora/misc/ext_table.html|Click here to view detailed description]
    h4. 1. Create a directory in Oracle where you have kept the xls file
    create or replace directory ext_dir as '/home/rene/ext_dir';h4. 2. grant read, write on directory ext_dir to scott;
    h4. 3. creating the external table
    create table ext_table_csv (
                                                i   Number,
                                                n   Varchar2(20),
                                                m   Varchar2(20)
                     organization external (
                                                     type   oracle_loader
                                                     default directory ext_dir
                                                    access parameters (
                                                                                 records delimited  by newline
                                                                                 fields  terminated by ','
                                                                                  missing field values are null
                                                   location ('file.csv')
                     reject limit unlimited;
    Note_
    If you want to update the excel file then create a view and then create the instead of triggers to do the update, delete or insert.[Creating views on external tables | http://www.dba-oracle.com/oracle_news/2005_9_1_updating_external_tables.htm]
    h3. 2. Use the data block wizard and connect to the corresponding schema and create a database block.
    Kindly click Correct or Helpful if it helps Thanks :-)

  • How can i read only .txt file and skip other files in Mail Sender Adapter ?

    Hi Friends ,
                       <b> I am working on scenario like , I have to read an mail attachement and send the data to R3.</b>
                        It is working fine if only the .txt file comes.
                      <b>Some times ,html files also coming along with that .txt files. That time my Mail adapter fails to read the .txt file.</b>
                       I am using PayLoadSwap Bean and MessageTransformBean to swap and send the attachment as payload .
                         <b>Michal as told to write the Adapter module to skip the files .But i am not ware of the adapter moduel . If any blogs is there for this kind of scenarios please give me the link.</b>
                           Otherwise , please tell me how to write adapter module for Mail  Sender Adapter?
                      How to download the following
                        newest patch of XI ADAPTER FRAMEWORK CORE 3.0
    from SAP Service Marketplace. Open the file with WinZip and extract the following
    SDAs:
    &#61589;&#61472;aii_af_lib.sda, aii_af_svc.sda
    &#61589;&#61472;aii_af_cpa_svc.sda
                        I have searche in servive market place .But i couldn't find that . Can you please provide me the link to download the above .
                      If any other suggestions other than this please let me know.
    Regards.,
    V.Rangarajan

    =P
    Dude, netiquette. Messages like "i need this now! Do it!" are really offensive and no one here is being payed to answer anyone's questions. We're here because we like to contribute to the community.
    Anyway, in your case, just perform some search on how you could filter the files that are attached to the message. The sample module is just an example, you'll have to implement your own. Tips would be to query the filename of the attachments (or maybe content type) and for the ones which are not text, remove them.
    Regards,
    Henrique.

  • How can i read the text files and buffer the data in Vector?

    hi. I have been running into this problem for days, but with no luck and losing right direction.
    The problem is : I am trying to read a text file and buffer the data into a
    Queue for each user.
    the sample text file is as below:( 1st column is timestamp, 2nd is user_id, 3rd is packet_id, 4th is packet_seqno, 5th is packet_size)
    0 1 1 1 512
    1 2 1 2 512
    2 3 1 3 512
    3 4 1 4 512
    4 5 1 5 512
    5 6 1 6 512
    6 7 1 7 512
    7 8 1 8 512
    8 9 1 9 512
    9 10 1 10 512
    10 1 2 11 512
    11 2 2 12 512
    12 3 2 13 512
    13 4 2 14 512
    14 5 2 15 512
    15 6 2 16 512
    16 7 2 17 512
    17 8 2 18 512
    18 9 2 19 512
    19 10 2 20 512
    20 1 3 21 512
    21 2 3 22 512
    22 3 3 23 512
    23 4 3 24 512
    24 5 3 25 512
    25 6 3 26 512
    26 7 3 27 512
    27 8 3 28 512
    28 9 3 29 512
    29 10 3 30 512
    30 1 4 31 512
    31 2 4 32 512
    32 3 4 33 512
    33 4 4 34 512
    34 5 4 35 512
    35 6 4 36 512
    36 7 4 37 512
    37 8 4 38 512
    38 9 4 39 512
    39 10 4 40 512
    40 1 5 41 512
    41 2 5 42 512
    42 3 5 43 512
    43 4 5 44 512
    44 5 5 45 512
    45 6 5 46 512
    46 7 5 47 512
    47 8 5 48 512
    48 9 5 49 512
    49 10 5 50 512
    50 1 6 51 512
    51 2 6 52 512
    52 3 6 53 512
    53 4 6 54 512
    54 5 6 55 512
    55 6 6 56 512
    56 7 6 57 512
    57 8 6 58 512
    58 9 6 59 512
    59 10 6 60 512
    60 1 7 61 512
    61 2 7 62 512
    62 3 7 63 512
    63 4 7 64 512
    64 5 7 65 512
    65 6 7 66 512
    66 7 7 67 512
    67 8 7 68 512
    68 9 7 69 512
    69 10 7 70 512
    70 1 8 71 512
    71 2 8 72 512
    What I wanna do is to read all the data above and buffer them in a queue for each user( there are only 10 users in total).
    I already created a class called Class packet:
    public class packet {
        private int timestamp;
        private int user_id;
        private int packet_id;
        private int packet_seqno;
        private int packet_size;
        /** Creates a new instance of packet */
        public packet(int timestamp,int user_id, int packet_id,int packet_seqno, int packet_size)
            this.timestamp = timestamp;
            this.user_id=user_id;
            this.packet_id=packet_id;
            this.packet_seqno=packet_seqno;
            this.packet_size=packet_size;
    }then I wanna to create another Class called Class user which I can create a queue for each user (10 users in total) to store type packet information. the queue for each user will be in the order by timestamp.
    any idea and sample code will be appreciated.

    Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
    Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave.

  • How can I read an audio file and brodcast it using NI RFSG?

    Hi everybody,
    I'm designing a wireless audio signal simulation system that will read an audio signal from a file and modulate the signal using NI 5671 RFSG, then broadcast it to be received at an NI 5660 RFSA. 
    All I need is some guidance from you guys. Some related examples would be of great help since I'm a new user of NI hardwares and software.
    Thanks in advance.
    Muslim,
    Communication Engineering Student,
    International Islamic University Malaysia. 

    Hi,
    I’m going to
    help here since Paul is out of the office, so far you have been able to use
    Paul’s example to generate a signal from a Wav File, right? I have a question:
    why did you combine some of the parts of the (fm-modulation) with the generate
    FM signal from WAV file if the example Paul attached is already modulating the
    signal?
    I have another question on the part
    that you are stuck when reading the file, do you want to play it back through
    your speakers or you just want to be able to see the array of samples? Have you
    seen the example “MT niRFSA Demodulate FM.vi”? And if so why it does not help? Here
    is another example for FM modulation: Sound File Frequency
    Modulated Generation using NI-567x I would like to let you know that all
    those examples Paul and I are giving you are located at our website most are
    free and you may find them yourself; if you have the necessary drivers and
    toolkits installed you should be good to go. “The examples
    available do not show what I'm searching for” What are you
    searching for? What type of analysis do you need to perform?
    Remember
    that in the RFSA part of your project what you are going to be receiving will
    be an array that contains all the points of your data not a WAV file. I will suggest trying to
    run both FM example the RFSG and RFSA with no modification for a better
    understanding of what is happening.
    I hope it helps
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters

  • Read Application server file and upload into internal table

    Another help needed guys,
    My file in the application server is of format
    Name       Marks 1    Marks  2       Marks 3............
    A                10             15               20
    The only thing separating the columns is space.
    Actually this file was downloaded from an internal table into the app server.
    Now I want to load it back into the internal table.
    How do I load this into internal table so that each column goes in separate internal table field.
    Currently am using cl_abap_char_utilities=>HORIZONTAL_TAB but I can get only the first column name in my field1 of the internal table.
    How should I applroach this?
    Points will be awarded for useful answers.
    Regards
    Ankit

    Hi ankit,
    i think u have uploaded the tab delimited file in the application sever.
    then suppose see if u r file is in the format of name#marks1#marks2#marks3.
    then in the program u do like this..
    first declare one internal table with one filed.
    data:
      c_hextab(1)      TYPE x VALUE '09'.
    data:
      begin of t_data occurs 0,
          line(256) type c,
      endof t_data.
    and declare one more intternal table
    data:
    begin of  t_itab occurs 0,
      name(15)    type c,
      marks1(4)   type c,
      marks2(4)   type c,
      marks3(4)   type c,
    endof t_itab.
    then
    open the file with
    OPEN DATASET p_file FOR INPUT IN TEXT MODE.
    then  between do and endo do like this..
    DO.
    clear t_data.
    READ DATASET p_file INTO t_data.
    if sy-subrc ne 0.
      exit.
    else.
    split t_data at c_hextab
          into t_itab-name
                t_itab-marks1
    t_itab-marks2
    t_itab-marks3.
    append t_itab.
    endif.
    enddo.
    i think it will be helpful to u
    Please let me know wht type of file has been uploaded into application server.(tab deleimted, comma separated or something else).
    Regards,
    Sunil Kumar Mutyala.

  • Read a excel file and split its sheets to seperate file ?

    Dear all :
    How to split a excel file into several file, each have one sheet.my code is as below,thanks:
    import org.apache.poi.hssf.usermodel.*;
    import java.io.*;
    import java.util.*;
    import org.apache.poi.poifs.filesystem.*;
    public class Extractxls {
    public static void main(String[] args) throws Exception
    try {
    POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(args[0]));
    HSSFWorkbook wb = new HSSFWorkbook(fs);
    int sheetCount = wb.getNumberOfSheets();
    System.out.println(sheetCount);
    try {
         while(sheetCount > 0) {
         sheetCount--;
         HSSFWorkbook wb1 = new HSSFWorkbook();
         HSSFSheet s = wb1.createSheet();
         String sheetName = wb.getSheetName(sheetCount);
         HSSFSheet sheet = wb.getSheet(sheetName);
    //     HSSFSheet sheet = wb.getSheetAt(sheetCount);
         System.out.println(sheet.toString());
         s = sheet;
    FileOutputStream fileOut = new FileOutputStream("atest" + sheetCount + ".xls");
    wb.write(fileOut);
    fileOut.close();
    } catch (Exception e) {
         System.err.println("Error: " + e.getMessage());
    } catch (Exception e) { e.toString();}

    The HSSFWorkbook class is part of the POI project:
    http://jakarta.apache.org/poi/
    Regards,
    Dave Gilbert
    JFreeChart Project Leader
    I understand poi porject, my problem is that POI can not read a excel file and split its sheets into seperate file (each have one sheet) ?Does any one know how to do it.

  • How can I read from a file line by line?

    Hi!
    Could someone post some code or explain how can I read from a file, and want I to read a line each time. How can I go to line number N?
    Thanks

    hi,
    u can try this:
    try     {
          // open text file
          BufferedReader in = new BufferedReader(new FileReader(fileName));
          String line=in.readLine();
          while((line=in.readLine()) != null) {
          System.out.println(line);
          }The go to line number N i m not so sure.
    Cheers
    Jerry

  • How to  read from excel file and write it using implicit jsp out object

    our code is as below:Please give us proper solution.
    we are reading from Excel file and writing in dynamicaly generated Excel file.it is writing but not as original excel sheet.we are using response.setContentType and response.setHeader for generating pop up for saveing the original file in to dynamically generated Excel file.
    <%@ page contentType="application/vnd.ms-excel" %>
    <%     
         //String dLoadFile = (String)request.getParameter("jspname1");
         String dLoadFile = "c:/purge_trns_nav.xls" ;
         File f = new File(dLoadFile);
         //set the content type(can be excel/word/powerpoint etc..)
         response.setContentType ("application/msexcel");
         //get the file name
         String name = f.getName().substring(f.getName().lastIndexOf("/") + 1,f.getName().length());
         //set the header and also the Name by which user will be prompted to save
         response.setHeader ("Content-Disposition", "attachment;     filename="+name);
         //OPen an input stream to the file and post the file contents thru the
         //servlet output stream to the client m/c
              FileInputStream in = new FileInputStream(f);
              //ServletOutputStream outs = response.getOutputStream();
              int bit = 10;
              int i = 0;
              try {
                        while (bit >= 0) {
                        bit = in.read();
                        out.write(bit) ;
    } catch (IOException ioe) { ioe.printStackTrace(System.out); }
              out.flush();
    out.close();
    in.close();     
    %>

    If you want to copy files as fast as possible, without processing them (as the DOS "copy" or the Unix "cp" command), you can try the java.nio.channels package.
    import java.nio.*;
    import java.nio.channels.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    class Kopy {
         * @param args [0] = source filename
         *        args [1] = destination filename
        public static void main(String[] args) throws Exception {
            if (args.length != 2) {
                System.err.println ("Syntax: java -cp . Kopy source destination");
                System.exit(1);
            File in = new File(args[0]);
            long fileLength = in.length();
            long t = System.currentTimeMillis();
            FileInputStream fis = new FileInputStream (in);
            FileOutputStream fos = new FileOutputStream (args[1]);
            FileChannel fci = fis.getChannel();
            FileChannel fco = fos.getChannel();
            fco.transferFrom(fci, 0, fileLength);
            fis.close();
            fos.close();
            t = System.currentTimeMillis() - t;
            NumberFormat nf = new DecimalFormat("#,##0.00");
            System.out.print (nf.format(fileLength/1024.0) + "kB copied");
            if (t > 0) {
                System.out.println (" in " + t + "ms: " + nf.format(fileLength / 1.024 / t) + " kB/s");
    }

  • How can I create an Excel file?

    Hi,
    How can I create an Excel file using Forms 6i.
    What I'm doing is to create a file using TEXT_IO package an name it .XLS. If a read it double-clicking over the file, it opens Ok but If I open directly from Excel it opens the Convert dialog.
    I need to create an excel file as it was made from within Excel.
    Thank in advance,
    Benjamin

    When you are talking about subfiles, are you talking like Package contents of an application?
    Terminal application in Applications -> Utilities can give a command line grasp of all your files using the du command.
    Type
    man du
    when entering the terminal, followed by the enter key.
    Note, by default the terminal opens at the Home folder.   To navigate outside the Home folder enter "/Volumes/name of mounted drive/folder/subfolder" as your path.  If there are spaces in the name, putting quotes around the whole path can help.    If you end your du command with a > name.txt a text file with the name name.txt will be plugged into your Home directory.  That you can open with Excel and parse by /es thus giving you everything in Excel.

  • How can I load an Excel File to a pipe-delimited .csv File

    In SSIS I am attempting to process a .xls File and I have a C# script that is reading the .xls File. My issue is this...I have some fields that have an embedded comma in them. Those fields are designated by a double quote though ". I have included my
    C# Script. I'm just not sure if I have to indicate to it that there is a field delimeter. The " double-quote is only utilized when there is indeed an embedded comma...like "Company Name, Inc"...or "Main St., Apt. 101"
    How can I read this .xls worksheet and account for the double-quotes and the embedded comma and produce a pipe-delimeted file?
    public void Main()
    // TODO: Add your code here
    // Create NEW .CSV Files for each .XLS File in the Directory as .CSV Stubs to store the records that will be re-formatted
    // in this Script.
    try
    string StringExcelPath = (Dts.Variables["User::FilePath"].Value.ToString());
    string StringExcelFileName = (Dts.Variables["User::FileName"].Value.ToString());
    string StringFileNameExtension = Path.GetExtension(StringExcelFileName);
    if (StringFileNameExtension != ".xls")
    return;
    string StringCSVFileName = (Dts.Variables["User::FileName"].Value.ToString());
    StringCSVFileName = Path.GetFileNameWithoutExtension(StringCSVFileName);
    StringCSVFileName = (Dts.Variables["User::FilePath"].Value.ToString()) + StringCSVFileName + ".csv";
    string StringExcelWorksheetName = (Dts.Variables["User::ExcelWorksheetName"].Value.ToString());
    string StringColumnDelimeter = "|";
    int IntHeaderRowsToSkip = 0;
    //FileStream stream = File.Open(StringFullyQualifiedPathFileName, FileMode.Open, FileAccess.Read);
    //// Reading from a binary Excel file ('97-2003 format; *.xls)
    //IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
    //// Reading from a OpenXml Excel file (2007 format; *.xlsx)
    //IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
    //// DataSet - The result of each spreadsheet will be created in the result.Tables
    //DataSet result = excelReader.AsDataSet();
    //// Free resources (IExcelDataReader is IDisposable)
    //excelReader.Close();
    if (ConvertExcelToCSV(StringExcelFileName, StringCSVFileName, StringExcelWorksheetName, StringColumnDelimeter, IntHeaderRowsToSkip) == true)
    Dts.TaskResult = (int)ScriptResults.Success;
    else
    Dts.TaskResult = (int)ScriptResults.Failure;
    catch (Exception)
    Dts.TaskResult = (int)ScriptResults.Failure;
    public static bool ConvertExcelToCSV(string sourceExcelPathAndName, string targetCSVPathAndName, string excelSheetName, string columnDelimeter, int headerRowsToSkip)
    try
    Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();
    Excel.Workbook ExcelWorkBook = ExcelApp.Workbooks.Open(
    sourceExcelPathAndName, // Filename
    0, // UpdateLinks ===> http://msdn.microsoft.com/en-us/library/office/ff194819(v=office.15).aspx
    true, // ReadOnly
    5, // Format ===> http://msdn.microsoft.com/en-us/library/office/ff194819(v=office.15).aspx
    "", // Password
    "", // WriteResPassword
    true, // IgnoreReadOnlyRecommended
    Excel.XlPlatform.xlWindows, // Origin
    "", // Delimeter
    true, // Editable
    false, // Notify
    0, // Converter
    false, // AddToMru
    false, // Local
    false // CorruptLoad
    // Gets the List of ALL Excel Worksheets within the Excel Spreadsheet
    Excel.Sheets ExcelWorkSheets = ExcelWorkBook.Worksheets;
    // Retrieves the Data from the EXACT Excel Worksheet that you want to process from
    Excel.Worksheet ExcelWorksheetToProcess = ExcelWorkSheets.get_Item(excelSheetName);
    // Gets the Range of Data from the EXACT Excel Worksheet that you want to process from
    Excel.Range ExcelWorksheetRange = ExcelWorksheetToProcess.UsedRange;
    // Sets the Cursor/Pointer at the Top Row of the Excel Worksheet
    Excel.Range ExcelRangeCurrentRow;
    // Deletes the Header Row and however many rows as specified in headerRowsToSkip
    for (int ExcelRowCount = 0; ExcelRowCount < headerRowsToSkip; ExcelRowCount++)
    ExcelRangeCurrentRow = ExcelWorksheetRange.get_Range("A1", Type.Missing).EntireRow;
    ExcelRangeCurrentRow.Delete(XlDeleteShiftDirection.xlShiftUp);
    // Replace ENTER, "\n", with a Space " "
    //ExcelWorksheetRange.Replace("\n", " ", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
    // Replace comma "," with the indicated Column Delimeter variable, columnDelimeter
    ExcelWorksheetRange.Replace(",", columnDelimeter, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
    // Saves Data File as .csv Format
    ExcelWorkBook.SaveAs(
    targetCSVPathAndName, // Filename (See http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.saveas.aspx)
    XlFileFormat.xlCSVMSDOS, // FileFormat
    Type.Missing, // Password
    Type.Missing, // WriteResPassword
    Type.Missing, // ReadOnlyRecommended
    Type.Missing, // CreateBackup
    Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive, // AccessMode
    Type.Missing, // ConflictResolution
    Type.Missing, // AddToMru
    Type.Missing, // TextCodepage
    Type.Missing, // TextVisualLayout
    false // Local
    ExcelWorkBook.Close(false, Type.Missing, Type.Missing);
    ExcelApp.Quit();
    GC.WaitForPendingFinalizers();
    GC.Collect();
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(ExcelWorkSheets);
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(ExcelWorkBook);
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(ExcelApp);
    return true;
    catch (Exception exc)
    Console.WriteLine(exc.ToString());
    Console.ReadLine();
    return true;
    #region ScriptResults declaration
    /// <summary>
    /// This enum provides a convenient shorthand within the scope of this class for setting the
    /// result of the script.
    /// This code was generated automatically.
    /// </summary>
    enum ScriptResults
    Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
    Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    #endregion

    I would prefer doing this using a standard data flow task component in SSIS. I will choose an Excel source and a flat file destination for this.
    See how you can handle the inconsistent/embedded delimiters within files inside SSIS data flow
    http://visakhm.blogspot.in/2014/06/ssis-tips-handling-embedded-text.html
    http://visakhm.blogspot.in/2014/07/ssis-tips-handling-inconsistent-text.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for

  • IPhone calendar will not sync with iCal on Mac

    Calendar entries on my iPhone 4S/iOS 5.1 will not sync with iCal on my MacBook Pro 2.4/10.6.8, but it will the other way around. I have tried: Restarting iPhone Re-setting sync services (holding down Option key and clicking on Sync icon in menu bar)

  • New order type creation ?

    Hi, While creating a new order type what points we need to remember ? And what information we need to get from the user. As per my knowledge i can create the order type as 01) Define order types 02) Order type dependent parameters 03) Define number r

  • Photoshop CS 4 Print problem with Canon copiers via IP

    Try to print from Photoshop CS 4 to two Canon color copiers and we get this error message, "Before you can perform printer-related tasks such as page setup or printing a document, you need to install a printer" Fifteen Macs: Mac Pro towers, MacBook P

  • Is there a way to rename a share in Leopard?

    Before Leopard is was possible to use the utility Sharepoints to rename a share without changing the name of the folder that was being shared. I have not yet found a way to rename a share using the Sharing preference in Leopard. Any know of a way to

  • Unable to sync (not download or send) Mail with Hotmail

    1) After the recent upgrade of hotmail to access it via a email client or mobile phone via its POP settings, I have been using it with the Apple Mail to download and send emails. It works perfectly without any flaw. But lately I noticed that whenever