How to extract data from multiple flat files to load into corresponding tables in SQL Server 2008 R2 ?

Hi,
          I have to implement the following scenario in SSIS but don't know how to do since I never worked with SSIS before. Please help me.
          I have 20 different text files in a single folder and 20 different tables corresponding to each text file in SQL Server 2008 R2 Database. I need to extract the data from each text file and
load the data into corresponding table in Sql Server Database. Please guide me in how many ways I can do this and which is the best way to implement this job.  Actually I have to automate this job. Few files are in same format(with same column names
and datatypes) where others are not.
1. Do I need to create 20 different projects ?
               or
    Can I implement this in only one project by having 20 packages?
             or
    Can I do this in one project with only one package?
Thanks in advance.

As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
Public
Sub Main()
' Add your code here 
Dim f1
As FileStream
Dim s1
As StreamReader
Dim date1
As
Object
Dim rline
As
String
Dim Filelist(1)
As
String
Dim FileName
As
String
Dim i
As
Integer
i = 1
date1 =
Filelist(0) =
"XYZ"
Filelist(1) =
"123"
For
Each FileName
In Filelist
f1 = File.OpenRead(FileName)
s1 = File.OpenText(FileName)
rline = s1.ReadLine
While
Not rline
Is
Nothing
If Left(rline, 4) =
"DATE"
Then
date1 (i)= Mid(rline, 7, 8)
 i = i + 1
Exit
While
End
If
rline = s1.ReadLine
End
While
Next
Dts.Variables(
"date").Value = date1(1)
Dts.Variables(
"date1").Value = date1(2)
Dts.TaskResult = ScriptResults.Success
End
Sub

Similar Messages

  • How to Extract data from a flat file and how to upload it into table

    Hi
    i want to extract the data from a web page, that data i want to keep in text file.
    from the text file i want to read it and i want to upload into table
    can any one help me its very urgent

    here is my 20min try without debugging (needs a rs232 and loopback connector )
    use the probe and highlight the dataflow to see how it works.
    as always:  there are many ways to solve your problem
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    read write file to RS232.vi ‏69 KB

  • JDBC-XI-FILE scenario. How to extract data from multiple tables

    Hi,
    At this moment I didn't have the access for XI system. So here I have some silly question. Could you please clarify the same ??
    If I got to extract data from single table using JDBC adapter I can put the below query in communication channel
    SELECT *FROM orders WHERE new='true'.
    But if I got to extract data from multiple tables, logic to be used should be like as shown below. ( from previous thread------prabhu).
    SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
    FROM <Table_1> INNER JOIN <Table_2> on
    <Table_1>.CARDNO = <Table_2>.CARD
    where REC_DAT = <condition>
    union
    SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
    FROM <Table_1> INNER JOIN <Table_2> on
    <Table_1>.CARDNO = <Table_2>.CARD
    where REC_DAT = <condition>
    But my query is ........how to put the above entire code in one line. (i.e in Qery place of communication channel ) ??
    Thanks
    Kumar

    Hi Palnati,
        You either use a select query with join or a stored procedure which will contain the logic to extract the data from multiple tables. But, the limitation in case of stored procedure is u can hv only one selct query in it.
    You write ur actual query provided in the parameter 'Query SQL Statement". u can also wrt a stored procedure in it. Also, u can provide a update statement in it which will update a certain flag so tht u don selct the data again.
    Check the following link
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm</a>
    Regards,
    Akshay
    Message was edited by:
            Akshay Salunke

  • How to extract data from multiple tables (always got errors)

    Dear Experts,
    I have a simple mapping to extract data from multiple tables as a source (A, B, C) to a target table (X). Below is the picture:
    (Sources)....(Target)
    A----------------***
    B----------------X
    C----------------***
    Sample Source Data:
    Table A:
    ColA1
    100
    200
    etc
    Table B:
    ColB1 ColB2 ColB3
    10 Y Ten
    20 Y Twenty
    30 Y Thirty
    etc
    Table C:
    ColC1 ColC2
    11
    12
    13
    etc
    Target table (X) should be (just has 1 group INGRP1):
    ColA1 ColB1 ColB3 ColC1
    100 10 Ten 11
    100 10 Ten 12
    100 20 Twenty 21
    etc
    Scenarios:
    1. Directly map from A, B, C to X. Unable to map with error message: "API8003: Connection target attribute group is already connected to an incompatible data source. Use a Joiner or Set operator to join the upstream data first before connecting it into this operator."
    2. Map each source to Expression Operator and then map from each Expression to target table. I am able to map all attributes successfully but got error when validating it with message: "VLD-1104: Attributes flowing into TEST.EXPR_SRC.INGRP1 have different data sources."
    How can I achieve the correct mapping for this purpose?
    Use Joiner? I have no key to join the sources
    Use Set? The sources have different number of columns
    Thanks in advance
    Prat

    Thanks Nico,
    I think it will results data like this:
    100 10 Ten 11
    200 20 Twenty 12
    300 30 Thirty 13
    etc
    and not the expected:
    100 10 Ten 11
    100 10 Ten 12
    100 20 Twenty 21
    etc
    But it inspired me to solve this by adding key expression in each source table (B & C) to be joined to table A with this formula:
    100+TRUNC(INGRP1.COLB1,-2)
    Regards
    Prat

  • How to Extract Data from the PDF file to an internal table.

    HI friends,
    How can i Extract data from a PDF file to an internal table....
    Thanks in Advance
    Shankar

    Shankar,
    Have a look at these threads:-
    extracting the data from pdf  file to internal table in abap
    Adobe Form (data extraction error)
    Chintan

  • How to extract data from the fields present in two or three tables

    Hi Experts,
          I have a scenario where i have to extract data from the fields of different tables. e.g. let there 2 tables which have some number of fields . I want the data of 3 fields each from these 2 tables. How can i get that??
    Sam

    Hi
    You can create view in tcode se11..
    here you include all tables from which you want to fetch the data..
    you need to give selection condition here
    eg..
    say select empname from table A, select empadd from table B.. where empno(from A)=empno(from B)
    (note that you dont need to write queries like this.. i have just given u the example)
    After creating the view you can create datasource in RSO2..
    Regards
    Swati

  • How to Extract data to a Flat File?

    Hello,
    Im using OWB 10g and Oracle 9.2 version of database. I want to know the complete steps of creating the flat file as my target module. I need to extract the data (source) from the oracle tables and load it into the flat files. Pls let me know your suggestions. Pls note except the flat files, I do not have any oracle tables as my targets.
    Thanks,
    Kishan

    Hi, here's an excerpt from some notes I wrote a few months ago, they shpoud be clear enough.
    0) the file will be created on the server using the utl_file package. So the path where the file will be created must be added to the utl_file_dir Oracle Server parameter. Request your DBA to complete this step.
    -In OWB client:
    1) create a file location (or use existing one) under "Files/Locations" in project tree
    2) create a new Flat File module (or use existing one) under "Files" ; associate it with the desired location (not really necessary)
    3) create a new mapping in an Oracle module
    4) add to mapping a table operator bound to the table to dump
    5) add to mapping un unbound Flat File (FF) Operator, give it a meaningful name
    6) drag the desired attributes from table to FF Operator. This will instruct OWB to feed the file with comma-separated values from the source table using the utl_file package. Be careful to format attributes accordingly to the format you want.
    7) reconcile outbound the FF Operator, creating a new flat file in the module created during step 2
    8) close mapping, right-click on it an from menu "Configure..."->"Sources&Targets"-><YOURTARGETFILE>, specify the desired output location and the output file name
    9) Open deployment manager and connect to runtime rep. If the FF location is new, register it by right-clicking+menu "Register" and specify parameters: operating system user/passawrd of the DB server, host and path where the file will be stored (must be the same added to utl_file_dir). ATTENTION: path info is stored in the generated mapping so be sure to redeploy mappings if changes occur
    10) deploy mapping, test execution
    11) OPTIONAL you can specify a different delimiter (TAB,etc) for the target file directly in its editor. But be careful then to reconcile inbound the FF op in the mapping before deploying.
    Cheers, Antonio

  • How can I make an easy *.CSV file to load into database table

    Hi All,
    I have a huge excel sheet having columns item#, description and qty. The description column sometimes maybe one word name, two word name separated with space or may be , spearated name. I want to write and PL/SQl code which will read this file and load it into database table. Now the *.CSV file is either comma delimited or tab text delmited which both do not solve my issue. Is there any better solution with anyone which can prevent the manual editing to the *.CSV file and I can easily load it to table.
    Your help is appreciated,
    Thanks
    Zahir

    SQL*Loader is probably the fastest method, but since you specifically asked for a PL/SQL method:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:464420312302

  • How to extract data from OMElement object file attachment SOAP Service

    We are having Axis2 Tomcat6 Webservice on SOAP WSDL
    The Webservice method is like this
    public String uploadGpxFile(OMElement omEle) throws AxisFault {
        // Extract file attachment from omEle
       // store in database
       return "ok";
    So, I just went through the documentation and executed
    omEle.getText();
    This printed the attached data like this
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Body>
          <ns:uploadGpxFileResponse xmlns:ns="..........">
             <ns:return><![CDATA[ MY REQUIRED XML DATA IS HERE ]]></ns:return>
          </ns:uploadGpxFileResponse>
       </soapenv:Body>
    </soapenv:Envelope>
    So, I essentially want to extract this data and store in database. My simple question is how to do it!
    It sounds crazy but, I am quite new to Java. I was actually debugging client and found there is a problem in server and started fixing it!! It would be very helpful if someone helps

    Hi,
    as far as i know you have to use sql to archive your goal, i.e. write your own methods for every complex sql-statement you want to use. thats the sad thing about the whole ORM-concept.
    Greetings,
    dsp

  • How to extract data from offline PDF files as batch processing

    Hello.
    I want to use Adobe Interactive forms as batch processing.
    For instances,
    1. Users download offline PDF files.
    2. Users inputs data on their local PCs.
    3. Users upload these PDF files in one folder.
    4. Program can read data form PDF files on that folder. and put data to ERP at night.
    I' d like to know how to implement a program with Java or ABAP.
    Regards.
    Koji.

    Hi,
    It's possible to do it but first be sure that the SAP system can read the directory while your program is executed in background .
    Then you have to read the content of the directory and process each file you found.
    Look at this standard ABAP object cl_gui_frontend_services , you will find method for browsing a directory and retrieve list of file .
    Afterwards you have to process each file , for this have a look at this wiki code sample i wrote for processing inbound mail with adobe interactive form, it should help you [Sample Code for processing Inbound Mail with Adobe Interactive Forms|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/sampleCodeforprocessingInboundMailwithAdobeInteractive+Forms]
    Hope this help you .
    Best regards.

  • How to extract data from a .txt file & send it to a serial port automatically

    Hi all
    I'm a final yr B.Tech student. I am new to the entire LABVIEW thing. But i hear its really good. My dept. in collge has purchased labview & i'm tryng to use it
    As i'm new to labview , i need help plz
    " I want to open a .txt file (in my PC) & transmit all the contents of the file via serial (COM) port to an 89%! microcontroller. Also i want to read the feedback messages from the microcontroller thru the serial port & save it to the same file in the PC.All this must be done automatically. ie, no manual intervention after execution starts"
    Kindly help me as i'm stuck here & unable to proceed further with my project

    here is my 20min try without debugging (needs a rs232 and loopback connector )
    use the probe and highlight the dataflow to see how it works.
    as always:  there are many ways to solve your problem
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    read write file to RS232.vi ‏69 KB

  • How to extract data from Essbase to Flat File using ODI

    Hi,
    Anyone know how to extract data from Essbase to Flat File using ODI?
    Thanks in advance.
    Regards,
    Sumardi

    Hi,
    Have you read through :-
    Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
    Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
    If you have read them and are still have a problem at what stage are you having the issues?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to extract data From Hyperion Essbase to Flat Files

    Hi ,
    Can anyone tell me how to extract data from Hyperion essbase to Flat file(e.g. .csv , .txt ,...) or Oracle Table using ODI.
    Regards,
    Avneet

    Hi sutirtha,
    I have make one column as key column now i am getting this error,
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 1, in ?
    com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
    at com.hyperion.odi.essbase.ODIEssbaseDataReader.getAppData(Unknown Source)
    at com.hyperion.odi.essbase.AbstractEssbaseReader.extract(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
    at org.python.core.PyMethod.__call__(PyMethod.java)
    at org.python.core.PyObject.__call__(PyObject.java)
    at org.python.core.PyInstance.invoke(PyInstance.java)
    at org.python.pycode._pyx7.f$0(<string>:1)
    at org.python.pycode._pyx7.call_function(<string>)
    at org.python.core.PyTableCode.call(PyTableCode.java)
    at org.python.core.PyCode.call(PyCode.java)
    at org.python.core.Py.runCode(Py.java)
    at org.python.core.Py.exec(Py.java)
    at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
    at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
    at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
    at com.sunopsis.dwg.cmd.e.k(e.java)
    at com.sunopsis.dwg.cmd.g.A(g.java)
    at com.sunopsis.dwg.cmd.e.run(e.java)
    at java.lang.Thread.run(Unknown Source)
    Caused by: com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
    at com.hyperion.odi.essbase.wrapper.EssbaseReportDataIterator.validateColumns(Unknown Source)
    at com.hyperion.odi.essbase.wrapper.EssbaseReportDataIterator.init(Unknown Source)
    ... 33 more
    com.hyperion.odi.essbase.ODIEssbaseException: com.hyperion.odi.essbase.ODIEssbaseException: The number of columns returned by script [10] is less than the source data columns exposed [12]
    at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
    at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
    at com.sunopsis.dwg.cmd.e.k(e.java)
    at com.sunopsis.dwg.cmd.g.A(g.java)
    at com.sunopsis.dwg.cmd.e.run(e.java)
    at java.lang.Thread.run(Unknown Source)

  • How to load data from a  flat file which is there in the application server

    HI All,
              how to load data from a  flat file which is there in the application server..

    Hi,
    Firstly you will need to place the file(s) in the AL11 path. Then in your infopackage in "Extraction" tab you need to select "Application Server" option. Then you need to specify the path as well as the exact file you want to load by using the browsing button.
    If your file name keeps changing on a daily basis i.e. name_ddmmyyyy.csv, then in the Extraction tab you have the option to write an ABAP routine that generates the file name. Here you will need to append sy-datum to "name" and then append ".csv" to generate complete filename.
    Please let me know if this is helpful or if you need any more inputs.
    Thanks & Regards,
    Nishant Tatkar.

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

Maybe you are looking for

  • Cannot sync music and videos to an iPhone 5 running iOS 8.0 b1 on iTunes 11.2.2

    Hey everyone. Yesterday, I decided to take the leap to iOS 8.0 beta 1 on my iPhone 5.  So far, things have been working ok (with the expected bugs here and there), except for this one thing above. After I got it all installed on my iPhone, I then pro

  • MBP 15" 10.6 does not boot up from Installation disc, why??????

    Good day, my question is simple, so please let the answer be simple: I have done partition on my MBP today, in order to give me more redundancy in case of a Hard drive failure. I witnessed one yesterday on a brand spanking Imac--> not pretty--> the w

  • Style sheet not linking is frame

    Hi, I have a frameset with three fames. Each of the frames links to a style sheet called site.css via and included file. None of the frames are linking the style sheet, but if I load each file independently they work fine it works like this... All fr

  • Recommended Modem to use with Airport Extreme

    I currently have AT&T DSL. It is connected to AT&T's really crummy 2Wire 2701HG-B modem/router combo. I want to ditch the 2Wire and replace it with the Airport Extreme router, but I am told that I will also have to buy a modem to hook up to the route

  • How to install a (universal) widget in Vista sidebar?

    I would like to install I Tunes timer widget f.i. but once unzipped I don't what & how to do to have it on my sidebar. Thanks