Importing '|' delimited text data in a db

Hi
I am a new newbie to the Oracle world, and would like some help on the following;
I have a 1,2Mb text file of data that I was to import into an oracle database. basically
what I need, is a block that does this.
Lets say there are 5 columns in the text file
separated by |'s containing both alpha-num and number chars.
Anyone ??
Thanks
null

Dear Mike,
What you need to do is use an Oracle utility called SQL*Loader that comes with the database software.
Let us assume that your text data is stored in a file called 'C:\TEXTFILE.DAT' and the data from this file is to be stored in a table called NEW_TABLE which is defined as follows:
create table NEW_TABLE
FIELD1 NUMBER(10),
FIELD2 VARCHAR2(10),
FIELD3 VARCHAR2(50),
FIELD4 VARCHAR2(30),
FIELD5 NUMBER(10)
Now you have to create the following SQL*Loader control file called, say TEXTFILE.CTL and place it in the "C" drive:
load data
INFILE 'c:\textfile.dat'
BADFILE 'c:\textfile.bad'
DISCARDFILE 'c:\textfile.dsc'
INSERT
into table NEW_TABLE
fields terminated by '|'
(FIELD1, FIELD2, FIELD3, FIELD4, FIELD5)
Finally you have to invoke the SQL*Loader utility from the command line as follows:
sqlldr userid=<YOUR_NAME>/<YOUR_PWD> control='c:\textfile.ctl'
where <YOUR_NAME> and <YOUR_PWD> are the ORACLE username and password respectively for the schema in which NEW_TABLE exists.
Ciao!
null

Similar Messages

  • Crystal and Delimited text data

    Need to import delimited text data into Crystal Reports 2008. What is the best method?

    David,
    Use MS Access instead. 
    If it's something you do on a regular basis, add the .txt file as a "Linked Table". That way, when you get a new file, you can simply overwrite the old file with the new.  Because the new .txt file has the same name and location as the one it replaced Access will never know that anything has changed and will simply provide the new data.
    Access is a MUCH better product than Excel for this type of operation.
    Jason

  • How to migrate Text data from one application to other

    Hi All,
    We've a old planning ASO application and users entered text data in data forms (Text cell) and also entered comments for the same cell
    Is there any way that we can import the Text data & comments from the old application to new application (few Dimensions are different between the 2 applications)
    Thanks,
    PVR

    Have you looked into using LCM as that can extract the relational data.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How do you import multiple sets of tab delimited text into your form?

    Is there an easy way to bring in form data from a text file of data values(tab delimited) with multiple instances of each variable?   In my current project, I would like to bring name, address, phone, etc data from the text file for a couple hundred people into a PDF form which I create and format to my given specs.  I know I can import the text and select which instance of the variable I want to populate the similarly named fields, but I was wondering if I could appropriately name or create the various fields in the form so that it would auto populate each subsequent instance of the variables with the next line of data?.  In this case, I want to end up with a nicely formatted address book.
    Thanks!

    It is possible but not just a simple import of data.
    Each form field in the multiple page PDF would need a unique name not repeated on another page of the PDF. Fortunately the Acrobat form standard includes the "template" object and this object can be spawned or used to add a new page with the form fields automatically renamed with a prefix string of the page number and template added to each form field on the new page. So if one were to import a row from your tab delimited file into the template, one could then spawn a new page from the template with the data and rename the fields so there would be no conflict of like named fields.
    A Lesson in Templates for Adobe Acrobat by Dave Wraight
    With newer versions of Acrobat there is a mail merge feature.
    Create PDFs from Word mail merges

  • Unable to import merep text file as a data object in DOE

    Dear All,
    I have exported a sync bo from MI 2.5 system, to a text file. Then i have tried importing the same text file into DOE. Then the following error has occured.
    "No active nametab exists for ZEFLMI_DOC_HDR_T51".
    I am unable to understand what could be the problem. Can someone please help me, how to resolve this issue, so that syncbo can be imported as a data object.
    Regards,
    Kiran.

    Hi,
    The backend for middleware should be same as what it was in MI.
    the erro comes when the corrosponding structure in a bapi doesnot exists in current backend.
    Please check if the structure ZEFLMI_DOC_HDR_T51 exists in backend.
    Thanks,
    Rohit

  • When I import a text file(comma separated )into a numbers spread sheet all the data goes into one column. Why does the text not go into separate columns based on the commas.

    When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators.  Excel allows you to do this during the import..  Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • Importing text data

    I am trying to import text data into an existing table in my database. After i select the file to be imported and then click on next i get the message "Page cannot be displayed". Any idea what might have gone wrong? One more thing...since i get this "page cannot be displayed" message immediately i am not sure if the page is timing out....ideally it shouldn't...

    In case anyone trawls back through this:
    I get this frequently (we're on 10g R2) when importing data from a text file to an existing table. Clicking the browser 'Back' button and re-selecting the file sorts it out.
    However, since the File Browse widget only seems to need the file path, I got into the habit of copying the path from the File Browse text field to the clipboard (click in field, CTRL-A then CTRL-C) so that I could just paste it back in rather than browsing for the file again.
    Strangely, whenever I do this, the import works fine and there is never a 'page not found' error - the 'page not found' error only ever occurs if I forget to copy the file path.
    Thought someone might find this tip useful, but if anyone knows why this is happening, I'd be very keen to hear.
    Thanks,
    John.

  • Efficent method to sort data from tab delimited text file

    I am currently writing a program to sort through data that was acquired and display it on a graph and some other indicators.  The file is a tab delimited text file with possibly 100,000s of data points.  the current method that I have tried using was that if I wanted all of the data from Oct, I would parse out the month from the timestamp, compare that to the desired month, and add it to the array if it is the same.  Other possible options of sorting are yearly and daily, possibly even hourly.
    The method does work, however it does take some time (up to a minute on a P4 3.6 GHz with 2 gb ram), and most of the other computers are not nearly as fast or with as much memory.  Is there a more efficent method to sorting the data??
    I attached my sorting vi as well as a sample data file.
    thanks for the advice.  It is saved in LV8.0.1
    Kenny
    Kenny
    Attachments:
    data sort.zip ‏84 KB
    oven1.txt ‏21 KB

    First of all, "sorting" has usually a different meaning (Sorting and numeric array ascending or descending, a string array aphabetically, etc.). Your data already seems sorted by date and time, you just want to pick a subset having certain characteristics.
    The main problem that is slowing you down is your constant growing of large arrays. This causes constant memory reallocations.
    Since your data is already sorted by date and time, all you need is to place your data in a sutable data structure, find the start and end point of your selection, then use "array subset" for example.
    Your code also seems to have a lot of unecessary complexity. See for example your "test for sort data" (see image below).
    the four cases only differ by filename --> only the file name belongs into the case and the file operation outside the inner case. Even better, just use autoindexing.
    that shift register does not do anything, because it always contains the same data. Using "index array" with index wired to [i] is equivalent to an autoindexing tunnel.
    You have a case structure to select which files to read, skipped files give you an empty array. Do you really need to do all these operations on an empty array. Why not place all code inside the TRUE case??
    Below is an image of one possible code alternative that addresses some of these points.
    Message Edited by altenbach on 10-26-2006 09:32 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    testForSortData.png ‏33 KB

  • Text data import wizard

    I need to add a text data import wizard much like Excel has to import data. I am wondering if there is a library that has these features somewhere. I do not want to write the whole thing from scratch since it will be time consuming and expensive for my client.
    Thanks

    LOL!! Yes, he's crazy!... No, actually, we are developing a cross platform application to begin with. And also, this client has desktops with Windows 2000 and ALL machines are locked (you cannot install or change anything in the machine, much less change the registry), except for a drive that is in the network. So, what we do is package custom Java applications with the JRE and all the libraries we need into a CD or that drive in the network and they run what they need. We have accomplish that with .NET as well. Anyway, that's why :)
    If anyone knows about the library, please, let me know ASAP.
    Thanks!

  • Downloading  pipe delimited text file on to desktop  with data in internal

    hi all,
    how  to download pipe delimited text file on to desktop  with data in internal
    table with an example plz.

    hi,
    u can use the FM GUI_DOWNLOAD.
    here is the sample code.
    *Internal table to hold the employee details
    DATA: it_details TYPE STANDARD TABLE OF x_details,
          wa_details TYPE x_details.
    *Internal table for file
    DATA: BEGIN OF  it_details_txt OCCURS 0,
            line(700),
          END OF  it_details_txt.
    *Employee details for the file
      CLEAR wa_details.
      LOOP AT it_details INTO wa_details.
        CLEAR it_details_txt.
        CONCATENATE
            wa_details-var1
            wa_details-var2
            wa_details-var3
            wa_details-var4
          INTO it_details_txt-line SEPARATED BY '|'.
        APPEND it_details_txt.
        CLEAR wa_details.
      ENDLOOP.
    *Download file in .TXT format to local desktop
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'data.txt'
          filetype                = 'ASC'
        TABLES
          data_tab                = it_details_txt
        EXCEPTIONS
          file_open_error         = 1
          file_write_error        = 2
          invalid_filesize        = 3
          invalid_type            = 4
          no_batch                = 5
          unknown_error           = 6
          invalid_table_width     = 7
          gui_refuse_filetransfer = 8
          customer_error          = 9
          no_authority            = 10
          OTHERS                  = 11.
      IF sy-subrc = 0.
        MESSAGE 'Data downloaded successfully' TYPE 'S'.
      ENDIF.

  • Importing an SQL Server TEXT data type field in Oracle - problem with LONG

    Hello,
    I work in Oracle 9i and I created a view on a distant SQL Server database that contains a TEXT data type field. But I have a problem when I select that field in Oracle; I have the following error message: "ORA-00997: forbidden use of LONG data type".
    Could anybody have a solution for me, to solve that problem?
    Thanks a lot!

    It is very difficult to suggest anything without seeing your code.  I don't even know if what you are seeing is the actual value or an error code.  Often, negative numbers are indicative of error codes. 
    For instance -1 could mean that you have an invalid reference or path, etc...
    Can you post your code?

  • How to get summary columns in delimited text file

    How to get summary columns in delimited text file
    I am trying to generate a delimited text file output with delimited_hdr = no.The report is a Group above report with summary columns at the bottom.In the text file the headers are not getting repeated & thats ok.The problem is the summary data is getting repeated for each row of data.Is there a way where i will get all the data & summary data will get displayed only once.I have to import the delimited text file in excel spreadsheet.

    Sorry there were a typos :
    When I used desformat=DELIMITEDDATA with desttype=FILE, I get error "unknown printer driver DELIMITEDDATA". When you look for help, DELIMITED is not even listed as one of the values for DESTFORMAT. But if you scroll down and look for DELIMITER it says , this works only in conjuction with DESTFORMAT=DELIMITED !!!!!!??!! This is in 9i.
    Has this thing worked for anybody ? Can anyone please tell if they were able to suppress the sumary columns or the parent columns of a master-detail data for that matter ?

  • Error while importing Item Master data through DTW

    Hello Expert,
      I trying to import item master data through DTW but it gives an error while importing as shown in attach file..
      Please help me...
      I am using SAP 9.0 Pl 6
    Regards,
    Sandy

    Hi Sandy,
    Kindly follow the check list
    1. Right Click DTW and run it as Administrator.
    2. Is your DTW version is same as SAP B1.
    3. Uninstall and re-install DTW.
    4. If you are using 64-bit DTW, try to use 32-bit one.
    5. Check the Template, is it of the same DTW version.
    6. Remove all the unnecessary columns.
    7. Last try different Template extension.. (e.g: CSV (Comma delimited), or Text (Tab delimited))
    Hope you find this helpful......
    Regards,
    Syed Adnan

  • How do I save a Number file to an delimited text file

    I was trying to import all my conatct that I created from Number to iList, I kept on failing, after I did some reaserch, and found out I need to save to an delimited text file. Can anybody help me? Or if anyone can direct me from import an Number file into iList, it would be wonderful, please help.
    Thank again

    You have a couple of options to convert the data to a tab-delimited file. The easist may be to copy the table from Numbers & paste it into a Pages word processing document. From there you can export it as a plain text file which you can then import.
    Jerry,
    IList Data is a database app that may be a solution for those moving from AppleWorks. It's more than Bento & less than FileMaker.

  • XML Column from table extract to Pipe Delimited Text File

    Hi,
    I have an XML column with large data in a Table ( Source SQL server Database).
    I was asked to   extract    XML column to .txt file using SSIS.
    Is it possible to extract xml column with huge data to text file ?
    when I tried,  select XML column from Table in source , I noticed  that Property of column is taken as [DT_NTEXT] . I Converted it to DT_TEXT as Ansi donot support DT_NTEXT.
    Execution method was success but it failed due to trucation. so wondering is there a way to get XML column extracted to Pipe delimited text file?
    Is it advisable to do this ? or IS It Valid to export XML in Pipe Delimited File ?
    Please Kindly advice
    thanks
    kodi

    Are you looking at shredding data within XML nodes and then importing it to text file or are you looking at exporting XML value as is? Also is SSIS a necessity?
    If not, You can simply use T-SQL for this along with bcp for this. just use a query like
    EXEC xp_cmdshell 'bcp "SELECT CAST(XMLColumn AS varchar(max)) AS Column FROM table" queryout <full file path> -c -S <ServerName> -T -t |'
    provided you use trusted connection (windows authentication)
    see
    http://visakhm.blogspot.in/2013/10/bcp-out-custom-format-data-to-flat-file.html
    If you want to shred the data use Xpath functions in the query as below
    http://visakhm.blogspot.in/2012/10/shred-data-as-well-as-metadata-from-xml.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

  • Do I need to download a security like norton?

    Do I need to add security measure like norton?

  • Disfonctionnement mac mini et TV Sharp

    Bonjour, J'ai acheté un mac mini que j'ai connecté à ma TV sharp. Au premier branchement, j'ai obtenu l'écran d'accueil du mac mini mais après quelques minutes d'utilisation, plus rien. Ma TV ne trouve plus le signal du mac mini. Pourriez-vous m'aide

  • Blocking/locking issue

    I need to find out what is the besy way to resolve blocking/locking issue in the database in case of when users are complaining his processes is hanging for last many hours. I tried to find out the actuall process that cause blocking by running queri

  • Can't pass params in xsql java program

    I tried xsql java program in the xml dev guide. It seems that the program failed to recognize the params. Here is my code:      Hashtable params = new Hashtable (3);      params.put("docid", "801");      params.put("orderby", "citeid");           par

  • Combining multiple pdf pages into a single document

    I realize this is probably an inappropriate request -- probably? almost certainly -- for this forum, but perhaps someone can refer me to another source for a solution. I would like to combine several pages individually scanned to pdf format into a si