How to remove CR from flat file in Windows

One of the columns in my table is varchar2(2000) and contains multi-line data.
New lines are identified by the linefeed terminator (chr(10)) in the table.
I am writing all records from this table to a flat file. My machine is running Win XP.
I am using UTL_FILE.PUT procedure to write to the file.
Problem is, for multi-line data each line gets appended with a <CR> in addition to the linefeed.
So each line in the file ends with <CR><LF> as opposed to only <LF> in the table.
So my question is, how do I get rid of this extra <CR> or chr(13) in the file ?
Is there anything I can set in the UTL_FILE package or alternatively is there any
DOS utility which can strip the file of the chr(13) ?
I understand this is Oracle default behaviour while writing to file on Win platform, i.e.
using a <CR><LF> as a line terminator. How can I change this behaviour.
Please help, very urgent !!
Regards,
Azhar.

Hi Kishore,
Thanx for the response.
What am trying to do is dump the table in a flat file.
Then create an External table (exactly same as original table) pointing to the flat file.
Due to occurence of the extra <CR> column length increases. For eg. multi-line column data of varchar2(2000) in original table having say 43 lines becomes 2042 characters now. As a result I will have to make external table with column length varchar2(2042) to read the column !! that's the problem.
I want external table definition to be exactly the same as original table.
This is part of a generic utility which am developing.
The only option I have right now is to use unix2dos utility and strip the <CR> characters, but I am looking for something which can eliminate <CR> at file creation itself.

Similar Messages

  • How to remove Unicode from XML file

    I get following error when unmarshal xml:
    [java] org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x15) was found in the element content of the document.
    Anyone know how to remove Unicode from xml file? Can I remove the unicode by rebuild the file?
    Thanks

    These sort of error usually occur when you're using a different character encoding to read the file than the one you wrote it with. Perhaps if you were to post the problem section of the file and/or the code that created it in the first place.

  • How to  upload data from flat file to datastore object in BI 7.0

    Dear friends,
    Please tell me
    step by step process for upload data from flat file to datastore object in BI 7.0
    <removed by moderator>
    please help me
    Thanks,
    D.prabhu
    Edited by: Siegfried Szameitat on Aug 17, 2011 11:40 AM

    Create transformation on thr data source and keep the DSO as the target and load.
    Ravi Thothadri

  • How to load Material from Flat File and convert to SAP Format

    Hi
              I am loading 0Material values from Flat File for mapping purpose. The format of Material in Flat File is "7704132". Within the system, i need to compare the value with 0Material values from the incoming data and update corresponding 0Material in records. for this purpose, I created dummy materials taking 0Material as template and trying to load data. I am getting invalid error- Version '7704132' is not valid RSDMD No194. Can anyone please let me know how to over come this issue. Should I include any routine in the data source or rules level. I am in BI 7.0.
    Thanks.

    Hi,
    Use the FM CONVERSION_EXIT_ALPHA_INPUT to convert the value into Internal format .Use this FM in the Transformations (field mapping).
    Search the forum with CONVERSION_EXIT_ALPHA_INPUT for more information on this.
    Regards,
    Anil Kumar Sharma .P

  • How to Create Hierarchy From Flat file Structure

    Hi Gurus,
    There is a scenario for me regarding the Hierarchy.
    Required Hierarchy structure - Region>Director>Manager-->Sales id
    I have flat file which gives the info like user id , sales id , manager id, director id.
    But the transaction data Flat file has structure with sales id, region id, sales amt, sales qty.
    Note : Region id is another Master Data.
    How i can create hierarchy from the first flat file which doesnot have region info in that but it is available in the transaction data Flat file.
    Is there anyway we can create hierarchy based on the first Flat file structure which contains more that 1,00,000 records.
    Try to Suggest me in this regard .
    This is urgent.
    Regards,
    Mano

    Hi Mano,
                    Defining the source system from which to load data
    Choose the source system tree File  ® Create.
           2.      Defining the InfoSource for which you want to load data
    Optional: choose InfoSource Tree ® Root (InfoSources) ® Create Application Components.
    Choose InfoSource Tree ® Your Application Component ® Other Functions  ® Create InfoSource 3.x ® Direct Update.
    Choose an InfoObject from the proposal list, and specify a name and a description.
           3.      Assigning the source system to the InfoSource
    Choose InfoSource Tree ® Your Application Component ® Your InfoSource ® Assign Source System. The transfer structure maintenance screen appears.
    The system automatically generates DataSources for the three different data types to which you can load data.
    &#9675;       Attributes
    &#9675;       Texts
    &#9675;       Hierarchies (if the InfoObject has access to hierarchies)
    The system automatically generates the transfer structure, the transfer rules, and the communication structure (for attributes and texts).
           4.      Maintaining the transfer structure / transfer rules
    Select the DataSource for uploading hierarchies.
    IDoc transfer method: The system automatically generates a proposal for the DataSource and the transfer structure. This consists of an entry for the InfoObject for which hierarchies are loaded. With this transfer method, the structure is converted to the structure of the PSA during loading, which affects performance.
    PSA transfer method: The transfer methods and the communication structure are also generated here.
           5.      Maintaining the hierarchy
    Choose Hierarchy Maintenance, and specify a technical name and a description of the hierarchy
    Hope this helps
    Regards
    Karthik
    Assign points if Helpful

  • How to delete data from flat file ?

    Hi all,
    I deleted a record from a tables and I want to delete it from data file.
    Can I do it ?
    Pls help me !

    What do you mean by deleting it from datafile ?, Is it flat file or something else you want to ask? I believe you have records in flat files and you want to delete them as soon as you load them into oracle table.Oracle dosent offer such facility, however you can syncronise your tables and flat file contents by using merge statements and update it in a fashion, so that only records which reflects in flat files syncronises with table in oracle database .
    hare krishna
    Alok

  • How to remove content from a file?

    i making a student system, whereas students can add their information in text file to the system.
    Format as followed
    firstname
    familyname
    student number
    firstname
    familyname
    student number
    firstname
    familyname
    student number
    how do we remove any certain info

    I think the easiest way is to read the file - manipulate the data in your application - write the data to the file with deleting the old content (append=false)

  • How to remove password from word file

    how do i remove the password from a word file

    Cursed from the start!
    I do however like that Apple removed the hatch and replaced it with that nice flyscreen!!
    Peter

  • How to read data from excel file in windows azure cloud service?

    I have a web application in visual studio 2010 and windows azure sdk.It asks the user to upload an excel file and then read its data
    to the database.When i ran the application on localhost it ran perfectly but when I run it using windows azure sdk emulator (using my application as a web role) it gives the error "The Microsoft.ACE.OLEDB.12.0' provider is not registered on the local
    machine".How to resolve this other than using OpenXml?

    You can access office documents only if office COM objects (means office) is installed on the machine.
    One option is using of Open.XML (why don't you want to use it?) and another option is to use Office365. However the later one would probably change the whole architecture of you application.
    One workaround might be to save Excel file as HTML and read it as HTML. This will not give you all of Open.XML and COM power, but you can very easy access and change data.
    Damir Dobric
    developers.de
    daenet.de
    daenet.eu
    daenet.com

  • Loading transaction data from flat file to SNP order series objects

    Hi,
    I am an BW developer and i need to provide data to my SNP team.
    Can you please let me know more about <b>loading transaction data (sales order, purchase order, etc.,) from external systems into order based SNP objects/structure</b>. there is a 3rd party tool called webconnect that gets data from external systems and can give data in flat file or in database tables what ever required format we want.
    I know we can use BAPI's, but dont know how. can you please send any <b>sample ABAP program code that calls BAPI to read flat file and write to SNP order series objects</b>.
    Please let me know ASAP, how to get data from flat file into SNP order based objects, with options and I will be very grateful.
    thanks in advance
    Rahul

    Hi,
    Please go through the following links:
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4180456
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4040057
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=3832922
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4067999
    Hope this helps...
    Regards,
    Habeeb
    Assign points if helpful..:)

  • Reading data from flat file in aplication server

    hi all,
    can any body provide code how to read data from flat file which is in application server.
    thanks in advance

    hi,
    chk this sample code.
    parameters: p_file like rlgrap-filename obligatory
    default '/usr/sap/upload.xls'.
    types: begin of t_data,
    vbeln like vbap-vbeln,
    posnr like vbap-posnr,
    matnr like vbap-matnr,
    werks like vbap-werks,
    megne like vbap-zmeng,
    end of t_data.
    data: it_data type standard table of t_data,
    wa_data type t_data.
    open dataset p_file for output in text mode encoding default.
    if sy-subrc ne 0.
    write:/ 'Unable to open file:', p_file.
    else.
    do.
    read dataset p_file into wa_data.
    if sy-subrc ne 0.
    exit.
    else.
    append wa_data to it_data.
    endif.
    enddo.
    close dataset p_file.
    endif.
    Rgds
    Anver

  • Convert amount from flat file format to user format

    hi,
    how to convert amount from flat file format to user specific format.
    input:  1000.00
    output: 1.000,00 (user specific)
    thanks in advance

    move that value to a type WRBTR variable
    and use write statement.
    data v_wrbtr type wrbtr.
    data v_char(20).
    v_wrbtr = 1000.
    write v_wrbtr to v_char.
    v_char will contain the amount in user format.
    Prerequsite, go to SU3 transaction.
    Defaults tab, chose the decimal notation .
    Regards,
    Ravi

  • Loading from flat file to dso using process chains

    hi,
    i am using BI7.0
    i am new to  process chains
    can anyone  explain how to load data from flat file to dso using process chains(i have created all the objects created) preffered if explained with an example

    You can find a lot info if you can searh SDN.
    Metachain
    Steps for Metachain :
    1. Start ( In this variant set ur schedule times for this metachain )
    2.Local Process Chain 1 ( Say its a master data process chain - Get into the start variant of this chain ( Sub chain - like any other chain ) and check the second radio button " Start using metachain or API " )
    3.Local Process Chain 2 ( Say its a transaction data process chain do the same as in step 2 )
    Steps for Process Chains in BI 7.0 for a Cube.
    1. Start
    2. Execute Infopackage
    3. Delete Indexes for Cube
    4.Execute DTP
    5. Create Indexes for Cube
    For DSO
    1. Start
    2. Execute Infopackage
    3. Execute DTP
    5. Activate DSO
    For an IO
    1. Start
    2.Execute infopackage
    3.Execute DTP
    4.Attribute Change Run
    Data to Cube thru a DSO
    1. Start
    2. Execute Infopackage ( loads till psa )
    3.Execute DTP ( to load DSO frm PSA )
    4.Activate DSO
    5.Delete Indexes for Cube
    6.Execute DTP ( to load Cube frm DSO )
    7.Create Indexes for Cube
    3.X
    Master loading ( Attr, Text, Hierarchies )
    Steps :
    1.Start
    2. Execute Infopackage ( say if you are loading 2 IO's just have them all parallel )
    3.You might want to load in seq - Attributes - Texts - Hierarchies
    4.And ( Connecting all Infopackages )
    5.Attribute Change Run ( add all relevant IO's ).
    Start
    Infopackge1A(Attr)|Infopackge2A(Attr)
    Infopackge1B(Txts)|Infopackge2B(Txts)
    /_____________________|
    Infopackge1C(Txts)______|
    \_____________________|
    ___________________|
    __\___________________|
    ___\__________________|
    ______ And Processer_ ( Connect Infopackge1C & Infopackge2B )
    __________|__________
    Attribute Change Run ( Add Infobject 1 & Infoobject 2 to this variant )
    1. Start
    2. Delete Indexes for Cube
    3. Execute Infopackage
    4.Create Indexes for Cube
    For DSO
    1. Start
    2. Execute Infopackage
    3. Activate DSO
    For an IO
    1.Start
    2.Execute infopackage
    3.Attribute Change Run
    Data to Cube thru a DSO
    1. Start
    2. Execute Infopackage
    3.Activate DSO
    4.Delete Indexes for Cube
    5.Execute Infopackage
    6.Create Indexes for Cube
    Some Links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/263de690-0201-0010-bc9f-b65b3e7ba11c

  • How to upload  schedule line from flat files to sap file

    dear all,
    i want to upload the schedule lines from flat files to sap schedulle lines
    but the flat files have 15 schedule lines and the data is as per date
    so how to upload that and the fields available in flat files are more than the sap screen
    we are having more than 6 items
    and 15scedule lines its abt 90data to be upload
    for one customer in every 15 day
    so how to do this
    is there any direct use in functional side
    with out the help of any abap
    but my user will do it
    so he need a permanent solution
    with regards
    subrat

    Hi Subrat ,
    u can upload the data either ( Master /Transaction) data with the help of lsmw. for that all u need to do is go through the lsmw and do it. in that u can go Batch input recording/ BAPI/ IDOC any of that. here i am sending the LSMW Notes go through it and do the work.
    once u create the LSMW project then u can ask the data from user or u can explain the user about the program and can run the flat file to upload the data.
    if u require LSMW material Just send me blank mail from u. my mail id is [email protected]
    Reward if Helpful.
    Regards,
    Praveen Kumar.D

  • How to avaoid space while reading from flat file

    Dear all
    I am using forms 10g.
    I am reading data from flat file using Text_io.
    In my exception part i have written like this
    EXCEPTION
      WHEN no_data_found THEN
          CLIENT_TEXT_IO.Fclose(in_file);But if in my last line from the flat file is some other characters then it is taking that also .
    How can i avoid it ?
    Note :- Other characters means you cannot see like this , when you press SHOW ALL CHARACTERS button in the NOTEPAD++ then it will show ...

    My File is like this ABC . There is no extension like ABC.txt .
    And in the file if the last line if blank space is there then it is coming to exception part , but if TAB is there then it is not coming .

Maybe you are looking for