Parsing Excel's CSV file in PL/SQL

Someone may need this...
This procedure parses a line of Excel's CSV file into a PL/SQL table's elements.
FUNCTION func_split_csv (p_string IN VARCHAR2)
RETURN gt_tbltyp_strings
IS
* NAME: func_split_csv
* PURPOSE: Split the passed Excel's CSV strings into tokens.
* Returns PL/SQL table of strings.
* REVISIONS:
* Author Date Description
* S.Stadnik 12/12/07 Initial
* PARAMETERS
* INPUT : p_string - String to be tokenized
* OUTPUT : None.
* RETURNS: PL/SQL table of strings.
TYPE gt_tbltyp_strings IS TABLE OF VARCHAR2(32000) INDEX BY BINARY_INTEGER;
-- Local constants
c_str_proc_nme CONSTANT VARCHAR2(100) := gc_str_package_nme||'.func_split_csv';
-- Local Variables
v_int_location PLS_INTEGER;
v_tab_tokens gt_tbltyp_strings;
v_str_token VARCHAR2(32000);
v_str_char VARCHAR2(1);
v_int_table_pos PLS_INTEGER := 1;
v_int_idx PLS_INTEGER := 1;
b_bln_open_quote BOOLEAN := FALSE; -- Flag, indicating that double-quote is opened
BEGIN
v_int_location := 0;
-- Is the string is empty, return an empty table
IF p_string IS NULL THEN
RETURN v_tab_tokens;
END IF;
-- If the string does not contain delimiters, return the whole string
IF InStr(p_string, ',', 1) = 0 THEN
v_tab_tokens(v_int_table_pos) := p_string;
RETURN v_tab_tokens;
END IF;
-- Loop thru all the characters
WHILE v_int_idx <= Length (p_string) LOOP
v_str_char := SubStr(p_string, v_int_idx, 1);
CASE v_str_char
-- Double quote encoutered (special case)
WHEN '"' THEN
-- If no double-quote was opened, this is an opening quote
IF b_bln_open_quote = FALSE THEN
b_bln_open_quote := TRUE;
-- '""' translates to '"'
ELSIF SubStr(p_string, v_int_idx + 1, 1) = '"' THEN
v_str_token := v_str_token || '"';
v_int_idx := v_int_idx + 1;
-- If double-quote was opened, this is a closing quote
ELSIF b_bln_open_quote = TRUE THEN
b_bln_open_quote := FALSE;
END IF;
-- Coma encoutered (special case)
WHEN ',' THEN
-- If double-quote was opened, this is part of the string
IF b_bln_open_quote = TRUE THEN
v_str_token := v_str_token || ',';
-- If double-quote was not opened, this is a delimiter, save the string
ELSE
v_tab_tokens(v_int_table_pos) := v_str_token;
v_str_token := '';
v_int_table_pos := v_int_table_pos + 1;
END IF;
-- Any other character is passed into the string
ELSE
v_str_token := v_str_token || v_str_char;
END CASE;
v_int_idx := v_int_idx + 1;
END LOOP;
-- If final token lenght is non-zero after we processed all the characters,
-- OR if the last character of the source string is ','
-- Add the final token into the table
IF Length(v_str_token) != 0
OR SubStr(p_string, -1, 1) = ',' THEN
v_tab_tokens(v_int_table_pos) := v_str_token;
END IF;
RETURN v_tab_tokens;
EXCEPTION
WHEN OTHERS THEN
-- Put your favourite error handler in here
END func_split_csv;

Yes, I agree.
That was written for a particular case:
- When the CSV file is an Excel's file,
- When it is impossible to put the file onto the DB server, so we couldn't use external tables, and the whole contents had to be passed as a CLOB parameter.

Similar Messages

  • How to import data from excel or csv files to Oracle table

    hello everybody,
    I am new here and new in Oracle. I would like to know the steps how to import data from excel or csv files to Oracle table.
    Let say I already have table inside the Oracle. Then my user give me the sets of data inside the Excel Worksheet.
    So, how can I import the excel data into Oracle table.
    Thank you in advance.
    cheers,
    shima

    Even easier. Download JDeveloper 11G from this site.
    Set up the database connection, right click on the table, select Import->Excel and specify your file to load it. On the import pop-up, you must view and update each tab indicating Columns, Data Types, and DML.
    Columns -- move the selected columns that you want to load to the box on the right
    Data Types -- select column name from second column to which the data for each column of the import file should load
    DML -- click this tab to generate the INSERT SQL
    Once done click 'Insert'

  • Load prompt values from Excel or CSV files?

    Hello all,
    We have report and users want to upload filters to prompts on the reports from excel or csv files. They cannot enter one by one because they some times have hundereds of values (customer numbers) to filter. Is there a way to do that? If it is then how is it possible?
    Thanks a lot.

    Hello Zahid,
    It is currently possible to create a relational multi-source universe with one data provider to an Excel document.
    for this to work for Web Intelligence the 62 bit drivers must be installed on the Webi Server for Excel.
    Here is a link to the kbase
    https://service.sap.com/sap/support/notes/1828466
    Also here is a link to the Information Design Tool Guide for how to create a multi-source universe:
    http://service.sap.com/sap/support/notes/1898185
    One of the new features in BI 4.0 is creating a list of values on a Table or custom SQL.
    also, here is the link to the available tutorials:
    Official Product Tutorials – SAP BusinessObjects Business Intelligence Platform 4.x
    Scroll down to the information design tool.
    Hope this helps!
    Jacqueline

  • SQlldr Error while uploading "excel" or "csv" file.

    Hello to community,
    We are using Oracle AS(application Server) 10g as a "web Server" & "database Server"
    The Database Server is having an NFS Partition,which has mounted onto "Web Server"
    So, if any client tried to upload any excel OR csv file , the Web Server will redirect that file data onto "database" server" through NFS partition.
    By clicking "upload" button from client end, they are getting a strange error. By checking "ias_console" log file, I have found below latest logs,which belongs to the error. Kindly let me know where is the problem coming from.
    The Database Server Shared NFS partition name is "web_upload" & we have same "web_upload" partition on the "web server". The command of mounting NFS partition is given below.
    On AIX web Server :- mount <ip address>:/file_data/web_upload/ /web_upload/
    SYNTAX :- <ip add of db server>/mount point "web server mount point"
    The error is as given below.
    09/06/09 15:27:47 NumIdle: 2
    09 Jun 2009 15:27:47,764 [DEBUG] - [ com.vat.website.service.DatabaseService ] [ private Connection getDBConnection() ] Exited
    09 Jun 2009 15:27:47,764 [DEBUG] - [ com.vat.website.service.DatabaseService ] [ private Connection getDBConnection() ] Exited
    09 Jun 2009 15:27:47,766 [DEBUG] - [ com.vat.website.service.DatabaseService ] [ private void initialize() ] After getDBConnection called,
      connection object is: org.apache.commons.dbcp.PoolableConnection@1048a893
    09 Jun 2009 15:27:47,767 [DEBUG] - [ com.vat.website.service.ExcelUploadService ] [ public boolean insertFileDetails(ExcelDataBean databean,String
      strFname) ] strUniqueKey:select  web_uploaded_file_history_seq.nextval from dual
    09 Jun 2009 15:27:47,767 [DEBUG] - [ com.vat.website.service.DatabaseService ] [ public ResultSet executeQuery(String strQuery) ] Entered
    09 Jun 2009 15:27:47,773 [DEBUG] - [ com.vat.website.service.DatabaseService ] [ public ResultSet executeQuery(String strQuery) ] Exited
    09 Jun 2009 15:27:47,774 [DEBUG] - [ com.vat.website.service.ExcelUploadService ] [ public boolean insertFileDetails(ExcelDataBean databean,String
      strFname) ] insertQuery:INSERT INTO WEB_UPLOADED_FILE_HISTORY(WUF_SERIAL_NUMBER,WUF_DEALER_ID,WUF_PERIOD_FROM,WUF_PERIOD_TO,WUF_FILE_PATH,WUF_FORM_NO,WUF_SERVER_IP,WUF_UPLOAD_YN,WUF_CREATED_DATE,WUF_CREATED_BY,WUF_ORIGINAL_REVISED,WUF_SHEETS_NUMBER,wuf_reco
      d_key)VALUES('2658271','T00100001000306',to_date('01/01/2009','dd/mm/yyyy'),to_date('31/01/2009','dd/mm/yyyy'),'/web_upload/090609/VAT
      Returns/000000/0000000000/Form201/0000000000_0T201BO0109_009062009152747.csv',replace(decode('T201B','T201M', 'T201','T201B'),'T','VAT-Form'),(select
      RPAD(sys_context('USERENV','IP_ADDRESS'),15,' ') AS client_ipaddress from dual),'Y',SYSDATE,'WEB','O','0','3317063')
    09 Jun 2009 15:27:47,791 [DEBUG] - [ com.vat.website.service.DatabaseService ] [ public void closeDBConnection() ] Entered
    09 Jun 2009 15:27:47,791 [DEBUG] - finalDate:01-JAN-2009
    09 Jun 2009 15:27:47,792 [DEBUG] - finalDate:31-JAN-2009
    09 Jun 2009 15:27:47,806 [DEBUG] - [ com.vat.website.utils.PropertyCache ] [ static Object getValue(String propertyName, String propertyFileName)
      ] Entered
    09 Jun 2009 15:27:47,806 [DEBUG] - [ com.vat.website.utils.PropertyCache ] [ static Object getValue(String propertyName, String propertyFileName)
      ] Entered
    09 Jun 2009 15:27:47,806 [DEBUG] - [ com.vat.website.utils.PropertyCache ] [ static Object getValue(String propertyName, String propertyFileName)
      ] Entered
    09 Jun 2009 15:27:47,806 [DEBUG] - [ com.vat.website.action.UploadAction ] [ public ActionForward submit(ActionMapping mapping, ActionForm
      form,HttpServletRequest request, HttpServletResponse response) ] Executing: sqlldr parfile=parafile.par silent=feedback direct=Y at location:
      /web_upload/090609/VAT Returns/000000/0000000000/Form201/SQLLdr
    It seems that this problem is due to "Sqlldr" then how to troubleshoot this problem?
    Waiting for your favorable response,
    Advanced Thanks,
    Nishith Vyas.

    Flat File was in error.

  • Help me in creating a Device Collection - i have a list of machine name (in a excel or CSV file)

    Hello Guys,
    I have created a Device collection for UK region (2000+ machines)
    Now i have been given a list of 1000 machines to which i need to deploy an application.
    I have to create a device collection for this 1000+ machines. as an input i have a excel or CSV file with a list of machine names.
    Please suggest me how can i create a device collection with CSV file as input. Is my CSV file should be in particular format.
    Or is there any other way i can create a collection for this 1000 specific machines.
    Please suggest.

    My previous post was for sccm 2012.
    here its for 2007
    In the Operating System Deployment section of SCCM right click on Computer Association and choose
    Import Computer Information
    when the wizard appears select Import Computers using a file
    The file itself must contain the information we need in this (CSV) format
    COMPUTERNAME,GUID,MACADDRESS
    (sample below)
    Quote
    deployvista,3ED92460-0448-6C45-8FB8-A60002A5B52F,00:03:FF:71:7D:76
    NEWCOMP1,55555555-5555-5555-5555-555555555555,05:06:07:08:09:0A
    NEWPXE,23CA788C-AF62-6246-9923-816CFB6DD39F,00:03:FF:72:7D:76
    w2k8deploy,BFAD6FF2-A04E-6E41-9060-C6FB9EDD4C54,00:03:FF:77:7D:76
    if we look at the last line, I've marked the computer name in Red, the GUID in BLUE and the MAC address in GREEN, separate these values with commas as above.
    w2k8deploy,BFAD6FF2-A04E-6E41-9060-C6FB9EDD4C54,00:03:FF:77:7D:76
    the file can be a standard TEXT file that you create in notepad, and you can rename it to CSV for easier importing into our wizard...
    so, click on Browse and browse to where you've got your CSV file
    on the Choose Mapping screen, you can select columns and define what to do with that mapping, eg: you could tell it to ignore the GUID value (we won't however)
    on the next screen you'll see a Data Preview, and this is useful as it will highlight any errors it finds with a red exclamation mark, in the example below a typo meant that it correctly flagged the MAC address as invalid
    so edit your CSV file again and fix the error, click previous (back) and try again
    Next choose the target collection where you want these computers to end up in
    review the summary
    in SCCM collections, we can now see the computers we've just imported from File,
    Enjoy
    Nikkoscy

  • Ssrs 2008 export to excel and csv file

    In a ssrs 2008 report, the user will export data to PDF, excel, and CSV files. When the report is exported to excel or csv file, the user wants me to hide some tablixes. Thus can you show me code on how to export the reports to csv or excel file without
    and be able to hide a few tablixes?

    Hi jazz_dog,
    According to your description, you want to set the visibility for some tablixes based on the exporting file type. Right?
    In Reporting Services 2008, we don't have any parameter to get type of exporting file. So we can only create a parameter and select a type before exporting to a file. Then use conditional expression to control the visibility. It's definitely not a good workaround,
    so your goal can't be achieved in Reporting Services 2008. However, for Reporting Service 2008R2 or later version, we have a build-in parameter called Render Format Name, this parameter will display the type of exporting file automatically. So we can make
    the judgment in expression based on the value of this parameter.
    Reference:
    Built-in Globals and Users References (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How To Split Large Excel or CSV Files into Smaller Files

    Does anyone know how to split a large Excel or CSV file into multiple smaller files?  Or, is there an app that will work with Mac to do that?

    split [-a suffix_length] [-b byte_count[k|m]] [-l line_count] [-p pattern] [file [name]]
    is a native Terminal command. Read up more on https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man1/split.1.html
    I prefer to use gSplit which is gnu coreutils.
    You can install gnu coreutils using homebrew.

  • Reading a CSV file with PL/SQL

    Hello:
    I have a CSV file provided to me by a client. We want to insert the data from this file into a table and perform other processing.
    Is it possible to call a CSV file within PL/SQL? If so, how do I begin?
    Thanks.

    Nawneet wrote:
    CSV file can load it using SQL loader
    go through the below link
    http://www.orafaq.com/wiki/SQL*Loader_FAQ
    SQL*Loader doesn't work very well in PL/SQL.
    Better is External Tables:
    http://www.morganslibrary.org/reference/externaltab.html

  • How to Read excel or .csv files in java

    I am writing a program which takes input as excel or .csv file.
    How to read these files.
    Any API's are existed or need to use the third party jar.
    Please suggest me.
    Thanks & Regards

    Did you search in google? Did you search here? There are so many excel related questions here, including answers about third party libraries.
    I have the impression that you didn't research at all.
    _[How to ask questions|http://faq.javaranch.com/view?HowToAskQuestionsOnJavaRanch]_ It's the same here.

  • Excel 2007 csv file formatting issue

    Our users create .csv files for upload to SAP. Their habit is to include a number of blank lines in excel to make it more readable.
    In Excel 2003, blank lines were handled as, literally, blank lines, and opening in a text editor shows exactly that, a blank line (with a CR-LF character to terminate the row).
    In Excel 2007 however, the blank line consists of a number of commas equal to the no. of columns, followed by the CR-LF termination. Hope that makes sense.
    While the 2003-generated .CSVs are fine, the 2007 versions cause SAP to throw an exception  ("Session never created from RFBIBL00") and the upload fails. The question therefore is, has anyone ever come across anything similar, or is anyone aware of any remediation that might be possible? Haven't been able to find any documentation on this Excel 2003-2007 change sonot able to address the issue through Excel config.
    Thanks!
    Duncan

    Hello
    Please refer to the consulting note 76016 which will provide information on the performance of the standard program
    RFBIBL00.
    Regards.

  • Exporting Quiz Results to Excel or .csv file

    I have a captivate file that I need to be able to export the
    data to a .csv file or a excel spreadsheet. I need to be able to do
    this as this is for a research project and will not be run with any
    network connectivity to an LMS. The data would then be imported
    into a database from that format. I would appreciate any help that
    someone could give me on this.

    Welcome to our community, David
    You may wish to review a Captivate Developer Center article
    that may help here.
    Click
    here to review the article
    Cheers... Rick

  • Upload csv file data to sql server tables

    Hi all,
    I want clients to upload csv file from their machines to the server.
    Then the program should read all the data from the csv file and do a bulk insert into the SQL Server tables.
    Please help me of how to go about doing this.
    Thanx in advance.....

    1) Use a multipart form with input type="file" to let the client choose a file.
    2) Get the binary stream and put it in a BufferedReader.
    3) Read each line and map it to a DTO and add each DTO to a list.
    4) Persist the list of DTO's.
    Helpful links:
    1) http://www.google.com/search?q=jsp+upload+file
    2) http://www.google.com/search?q=java+io+tutorial
    3) http://www.google.com/search?q=java+bufferedreader+readline
    4) http://www.google.com/search?q=jdbc+tutorial and http://www.google.com/search?q=sql+tutorial

  • Loading table from Access, Excel or CSV file

    Hi,
    I would like to know the mechanism of loading a table from an external source such as Access table, Excel sheet, text file containing comma/tab delimited values.
    Can you please indicate me the basic steps to prepare the extraction of the source data and next how to load this data into a target Oracle table?
    Thanks very much in advance.

    If you are using a windows based Oracle server you can locate your files on the server and set them up as external databases using Oracles Heterogeneous Services (HS)... e.g. with Excel workbook...
    1- Go to Control Panel>Administrative Tools>Data Sources (ODBC)>System DSN and create a data source with appropriate driver. Name it EXCL.
    2- In %ORACLE_HOME%\Network\Admin\Tnsnames.ora fie add entry:
    EXCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.0.24)(PORT = 1521))
    (CONNECT_DATA =
    (SID = EXCL)
    (HS = OK)
    Here SID is the name of data source that you have just created.
    3- In %ORACLE_HOME%\Network\Admin\Listener.ora file add:
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = <hs_sid>)
    (ORACLE_HOME = <oracle home>)
    under SID_LIST_LISTENER like:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = d:\ORA9DB)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ORA9DB)
    (ORACLE_HOME = d:\ORA9DB)
    (SID_NAME = ORA9DB)
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = EXCL)
    (ORACLE_HOME = D:\ora9db)
    Dont forget to reload the listener
    c:\> lsnrctl reload
    4- In %ORACLE_HOME%\hs\admin create init<HS_SID>.ora. For our sid EXCL we create file initexcl.ora.
    In this file set following two parameters:
    HS_FDS_CONNECT_INFO = excl
    HS_FDS_TRACE_LEVEL = 0
    5- Now connect to Oracle database and create database link with following command:
    SQL> CREATE DATABASE LINK excl
    2 USING 'excl'
    3 /
    Database link created.
    Now you can perform query against this database like you would for any remote database.
    SQL> SELECT table_name FROM all_tables@excl;
    TABLE_NAME
    DEPT
    EMP
    With MS Access you are already dealing with a database so the structure is not a problem. If you treat Excel workbooks as a database then they have to conform to a certain layout e.g. each worksheet is in effect a table with the name of the table taken from the worksheet name (be aware that Excel allows 32 characters for sheet names, but Oracle requires no more than 30), on each sheet the first row must contain the column names and all subsequent rows contain the data.
    ;)

  • Converting .xls to .csv file using pl/sql

    Hi All,
    i have a directory say 'C:\datafile\'. I will be getting .xls file into this directory. I need to change it to .csv and load into oracle tables using sql loader.
    Any inputs on this..
    thanks..

    Etbin wrote:
    Even if there's only table data to deal with it will be quite demanding to ignore just colors, font types, formats, sizes you name it the "innovative" users can think of.Even if it had no additional formatting by users and was just a spreadsheet populated with table style data, it would still be nigh on impossible to read the contents intelligently, using any of the file access facilities available as standard in PL/SQL (e.g. UTL_FILE)...
    Just looking at the contents of the file in notepad, where many of the bytes are unmappable to readable characters...
    ÐÏࡱᠠ              >  þÿ                              þÿÿÿ    þÿÿÿ       ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ        u'ÍÁ€    á  °Á    â   \ p   user                                                                                                         B  °a   À  =  œ               ¯   ¼   =  x - Ð\.;8      X@        "       ·   Ú    1 &     ÿ      C o u r i e r   N e w 1 &     ÿ      C o u r i e r   N e w 1 &     ÿ      C o u r i e r   N e w 1 &     ÿ      C o u r i e r   N e w     "£"#,##0;\-"£"#,##0    "£"#,##0;[Red]\-"£"#,##0    "£"#,##0.00;\-"£"#,##0.00#    "£"#,##0.00;[Red]\-"£"#,##0.005 * 0  _-"£"* #,##0_-;\-"£"* #,##0_-;_-"£"* "-"_-;_-@_-, ) '  _-* #,##0_-;\-* #,##0_-;_-* "-"_-;_-@_-= , 8  _-"£"* #,##0.00_-;\-"£"* #,##0.00_-;_-"£"* "-"??_-;_-@_-4 + /  _-* #,##0.00_-;\-* #,##0.00_-;_-* "-"??_-;_-@_-à      õÿ            À à     õÿ   ô        À à     õÿ   ô        À à     õÿ   ô        À à     õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à      õÿ   ô        À à                   À à   + õÿ   ø        À à   ) õÿ   ø        À à   , õÿ   ø        À à   * õÿ   ø        À à         õÿ   ø        À “ €ÿ“ €ÿ“ €ÿ“ €ÿ“  € ÿ“ €ÿ`   …  Ö     Sheet1Œ   , Á Á  T ü H                   EMPNO  ENAME  MGR  DEPTNO  FRED  JIM  BOB  JAMES  TIMÿ   |     ¶  F  
               u'ÍÁ€                ’  L 
         d          ü©ñÒMbP?_   *    +    ‚   €          %   á   Á      ƒ    „    ¡ "   á               à?      à?  U                       á            á            á            á            á            á       ý
              ý
            ý
            ý
            ~
           ð?ý
           ~
          $@~
            @ý
           ½       ð?   4@ ~
           @ý
           ½       ð?   $@ ~
           @ý
           ½        @   4@ ~
           @ý
           ½        @   4@ ×  ¢  d 8 * 2 2 2 > ¶    @                          ï    7   (Note: it was cut short, this is just an example)
    Let's face it, you just wouldn't want to try and decipher that. That's what Microsoft have provided ODBC drivers for.

  • Read a csv file and update sql db

    I'm a newbie to C#. I've put together the code below - see two commented lines where the for loop starts. need advise as to the correct approach. you may insert pseudo
    code in appropriate places. Thanks in advance.
    Below is my code:
    public class MailingConfirmationService
            private SqlConnection _con = new SqlConnection(ConfigurationManager.AppSettings.Get("ConnectionString"));
            public void ProcessFilesForMailingConfirmation()
                //Process file(s)
                IResource resourceFile = ResourceFactory.GetResourceFile(ResourceList.FileLocation);
                DirectoryInfo dataFiles = new DirectoryInfo(resourceFile.GetString("filesourcelocation"));
                if (dataFiles.GetFiles().Length > 0)
                    log.Info("File Processing started");
                    foreach (FileInfo dataFile in dataFiles.GetFiles("*.csv"))
                        log.Info("Processing Data File: " + dataFile.Name);
                        if (dataFile != null && dataFile.Name.Contains("IN"))
                            foreach (string sLine in File.ReadLines(dataFile))                     
                                      _con.Open();
                                    cmd.ExecuteNonQuery();
                                    _con.Close();

    The   foreach (string sLine in File.ReadLines(dataFile))
      should be  foreach (string sLine in File.ReadLines(dataFile.FullName))
    its expecting path as param.
    Check also for this example to enumerate files and their lines:
    https://msdn.microsoft.com/en-us/library/dd383503%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
    Fouad Roumieh

Maybe you are looking for

  • Syncing a new iPad 2

    I am going to buy an iPad 2 whilst on holiday in the USA, I am from the UK. Do I need to take my home laptop with me to sync the new iPad 2 to my iTunes account or will it work straight out of the box without syncing?

  • External email not working.

    Before I got my Mac I had an AOL email. When I got my Mac I connected it to my email icon and it has so far worked. All emails sent to the AOL mail are sent to my Mac. When I got an iPhone I connected the mail to that too. For over a year it has work

  • MCSA: Windows 7 to MCSA: Server 2012 (70-417)

    Hello, I currently have the 70-680 certification. I have read that the MCITP: Enterprise Desktop Support Technician on Windows 7 (70-680 + 70-685) will retire 31 januari. I have read that the MCITP: Enterprise Desktop Administrator on Windows 7 (70-6

  • Elements 10 and the AAMEE_2_1 installer

    Hi I have Photoshop Elements 10 and am trying to customize it using the AAMEE 2.1 installer tool. When i point the tool to the "Product Install Folder" location and choose "32-bit Package" it says "A Valid installer could not be found"..if i point it

  • 2LIS_08TRFKZ

    Hi, Can anybody give the BI content link for Shipment 2LIS_08TRFKZ and 2LIS_08TRTK. Thanks.