Converting CSV file coming as string in one of the field of xml to XML

Hi ,
we have the below requirement where the dat type is :
DT_MESSAGE
  field1  Data
   field2 DataString
the csv file of the below format will be sent in the DataString field of xml .
Source;EIX3;Date;080526;Charge;70199;Si;.42   ;Fe;.20   ;Cu;.00   ;Mn;.027  ;Mg;.49   ;Cr;.0007 ;Ni;0     ;Zn;.01   ;Ti;.01   ;Ag;0     ;B;0     ;Ba;0     ;Be;0     ;Bi;0     ;Ca;0     ;Cd;0     ;Co;0     ;Ga;0     ;Na;0     ;Nb;0     ;Pb;0     ;Sb;0     ;Sn;0     ;Sr;0     ;V;0     ;Zr;0     ;Al;0     ;P;0     ;Hg;0     ;Li;0     ;Alloy;606044;Alloy_Hy;AC10;Diametre;152;Client;IMPOL
Source;EXF3;Date;080811;Charge;71460;Si;.04   ;Fe;.10   ;Cu;.002  ;Mn;.003  ;Mg;.002  ;Cr;.0006 ;Ni;.003  ;Zn;.014  ;Ti;.000  ;Ag;0     ;B;0     ;Ba;0     ;Be;0     ;Bi;0     ;Ca;0     ;Cd;0     ;Co;0     ;Ga;0     ;Na;0     ;Nb;0     ;Pb;.0010 ;Sb;0     ;Sn;.000  ;Sr;0     ;V;.001  ;Zr;0     ;Al;99.8  ;P;0     ;Hg;0     ;Li;0     ;Alloy;400101;Alloy_Hy;831B9901;Diametre;PFA;Client;DANFOSS
Source;EXF3;Date;080813;Charge;71535;Si;9.55  ;Fe;.12   ;Cu;1.05  ;Mn;.01   ;Mg;.38   ;Cr;.0008 ;Ni;.00   ;Zn;.01   ;Ti;.01   ;Ag;0     ;B;0     ;Ba;0     ;Be;0     ;Bi;0     ;Ca;.0011 ;Cd;0     ;Co;0     ;Ga;0     ;Na;.0006 ;Nb;0     ;Pb;.0010 ;Sb;.0003 ;Sn;.00   ;Sr;.0002 ;V;0     ;Zr;0     ;Al;0     ;P;.0008 ;Hg;0     ;Li;.0001 ;Alloy;444205;Alloy_Hy;Al AS9C1;Diametre;PFA;Client;TEKSIDPL
Source;EXF3;Date;080813;Charge;71538;Si;9.57  ;Fe;.12   ;Cu;1.01  ;Mn;.01   ;Mg;.39   ;Cr;.0008 ;Ni;.00   ;Zn;.01   ;Ti;.01   ;Ag;0     ;B;0     ;Ba;0     ;Be;0     ;Bi;0     ;Ca;.0007 ;Cd;0     ;Co;0     ;Ga;0     ;Na;.0004 ;Nb;0     ;Pb;.0010 ;Sb;.0004 ;Sn;.00   ;Sr;.0002 ;V;0     ;Zr;0     ;Al;0     ;P;.0007 ;Hg;0     ;Li;.0001 ;Alloy;444205;Alloy_Hy;Al AS9C1;Diametre;PFA;Client;TEKSIDPL
Source;EIX3;Date;080813;Charge;71539;Si;.06   ;Fe;.19   ;Cu;.00   ;Mn;.00   ;Mg;.00   ;Cr;0     ;Ni;0     ;Zn;.01   ;Ti;.01   ;Ag;0     ;B;0     ;Ba;0     ;Be;0     ;Bi;0     ;Ca;0     ;Cd;0     ;Co;0     ;Ga;0     ;Na;0     ;Nb;0     ;Pb;0     ;Sb;0     ;Sn;0     ;Sr;0     ;V;0     ;Zr;0     ;Al;99.71 ;P;0     ;Hg;0     ;Li;0     ;Alloy;107070;Alloy_Hy;AC99.7;Diametre;152;Client;ARO TUBI
where the starting field is Sorce of each row .
I need to parse the above csv using xslt or java mapping .
The target structure xml is
DT_Target
   row  0 to unbounded
field 1  Source
field2   Date
field3   Charge
field n   Client
can anyone help me how to parse and map to the target.what could be the better method to do it.
Thanks and Regards,
Rajesh

You can use xsl mapping to  retrieve that payload ina  single field and map it to target
Please check these links
String to XML using XSLT..
Re: String to XML using XSLT
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
regards
Ninad

Similar Messages

  • How to convert csv files into java bean objects?

    Hi,
    I have a CSV file, I want to store the data availabale in that csv file into java bean, I am new to this csv files how can I convert CSV files into java beans.
    Please help me.
    Adavanced Thanks,
    Mahendra

    You can use the java.io API to read (and write) files. Use BufferedReader to read the CSV file line by line. Use String#split() to split each line into an array of parts which were separated by comma (or semicolon). If necessary run some escaping of quotes. Finally collect all parts in a two-dimensional List of Strings or a List of Javabeans.
    java.io API: [http://www.google.com/search?q=java.io+javase+api+site:sun.com]
    java.io tutorial: [http://www.google.com/search?q=java.io+tutorial+site:sun.com]
    Basic CSV parser/formatter example: [http://balusc.blogspot.com/2006/06/parse-csv-upload.html]

  • Route Pattern CSV File Removes "0" from Called Party Prefix Digits Field

    I want to upload over 350 route patterns using BAT Tool in CUCM 9.1. All patterns must have their Called Party Prefix Digits (Outgoing Calls) Field containing 10 numbers with the number "0" at the begining. The Problem is the CSV file removes the leading "0" form the digits. I tried to make the cell type in Excel as "Text" and it worked and the "0" is kept normally, but when I save and close the file then open it again, the cell is defaulted to "General" type and the "0" is disappeared again! Changing the CSV file format to any other one and uploading it to CUCM system generates an error stating that the file format is not supported.
    Attached is a sample entry of the CSV file. I want to preserve the whole number "0541234567" in "PREFIX_DIGITS_CALLED_PARTY" Field.
    Anyone can help me how to upload this big number of route patterns while preserving the number "0" at the begining?

    Make sure you change the csv file when using Excel to "Text" on the cell where the string starts with 0, otherwise Excel assumes this is a number and strips it.
    HTH, please rate all useful posts!
    Chris

  • When downloading a .csv file in Safari, it adds .xls, making the file filename.cvs.xls

    When downloading a .csv file in Safari, it adds .xls, making the file filename.cvs.xls
    If I rename the file, it opens just fine, if I don't it opens all in one column.
    I had found a fix on my old macbook, but just got a new MBP and it's happening again.
    Can't remember or find where the fix is.
    Thanks!

    Safari: Downloaded file's filename may have an additional extension
    http://support.apple.com/kb/TA24293
    That's from June 11, 2007!
    Working from my defective memory, this happened to me, but stopped if I unchecked 'Open safe files after downloading' in Safari Preferences/General.
    At least I think that's how I stopped it - it hasn't happened since!

  • How do you convert .AVI files for using in iMovie without losing the original clip time and date

    Hi everyone! does anyone know how to convert .AVI files for using in iMovie without losing the original clip time and date? Handbrake, MPEG Streamclip and Evon all replace the original timecode with the date of modification. This is very frustrating when you are trying to keep the chronology right. I know that if you upload the files to iMovie from one device the chronology isn't a problem, but I'm adding video files from a couple of iPhones and a couple of camcorders. any help much appeciated.
    paul

    Hi everyone! does anyone know how to convert .AVI files for using in iMovie without losing the original clip time and date? Handbrake, MPEG Streamclip and Evon all replace the original timecode with the date of modification. This is very frustrating when you are trying to keep the chronology right. I know that if you upload the files to iMovie from one device the chronology isn't a problem, but I'm adding video files from a couple of iPhones and a couple of camcorders. any help much appeciated.
    paul

  • How to get the Output File Name as One of the Field Value From Payload

    Hi All,
    I want to get the Output file name as one of the Field value from payload.
    Example:
    Source XML
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_TEST xmlns:ns0="http://sample.com">
    - <Header>
      <NAME>Bopanna</NAME>
      </Header>
      </ns0:MT_TEST>
    I want to get the Output file name as " Bopanna.xml"
    Please suggest me on this.
    Regards
    Bopanna

    Hi,
    There are couple of links already available for this. Just for info see the below details,
    The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
    //       Description: Function to create dynamic Filename
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    With this udf map it with the MessageType as
    (File Name field from Payload) > DynamicFileConfiguration>MTReceiver
    Thanks
    Swarup

  • I have just owned a macbook pro and trying to learn things since i have all along used windows laptop. My first question is : when there are two files i am working together, one above the other on screen, how you switch over between the two with key ?

    I have just owned a macbook pro and trying to learn things since i have all along used windows laptop. My first question is : when there are two files i am working together, one above the other on screen, how you switch over between the two with key ?

    Hi...
    Mac OS X keyboard shortcuts
    Control-F4
    Move focus to the active (or next) window
    Shift-Control-F4
    Move focus to the previously active window
    By the way...  since you are new to Mac, click a clear space on your Desktop. You should see "Finder" top left corner of the screen in the menu bar.
    Click Help then click Help Center
    As an example type in    keyboard shortcuts
    You can use the Help menu for almost any application on your Mac.
    Apple - Find Out How - Mac Basics
    For held switching from PC to Mac >  Apple - Support - Switch 101

  • Date differences if one of the field not presenting

    Hi All,
    I have two attributes start date and end. I have created formula replacement variable.
    some  times one of the field coming as blank, in such acase system writing some garbage value but i need blank.
    How to resolve this issue.
    Reagrds,
    J B

    Hi,
    You can create a new formula in query designer with a condition such that date difference doesn't fall in the invalid value. If it that invalid value put the result as '0'.
    http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/frameset.htm
    If the output is showing as '0' for the invalid values then in the query properties select the Display zeroes as Do Not Display Zeroes.
    http://help.sap.com/saphelp_nw04/helpdata/en/1e/99ea3bd7896f58e10000000a11402f/frameset.htm
    Hope this helps.........
    Rgs,
    Ravikanth.

  • To replace values of one of the field in the database table

    How to replace values of one of the field in the database table with a new values? Pls help to solve

    Hi
    You can use the UPDATE command to update one of the field value in a table
    see the UPDATE syntax and use it
    but in real time you should not do like this
    Regards
    Anji

  • Additional validation for one of the fields in down payment request

    Hi All ,
      I have a requirement for doing some additional validation for one of the fields in down payment request
    (F-47) .
    I need to validate a field u2018Assignmentu2019 in the down payment request .
    Here, assignment field is mandatory and user has to enter a valid contract number. Then we have to  validate the contract number entered against the tracking number field (BEDNR) in EKPO table corresponding to the vendor.
    If the contract number entered is incorrect, then system displays a message with the valid contract number. The user can modify the assignment field with this contract number. Once the field is modified, system once again validates whether the contract number entered is valid.
    Can you please provide me your valuable inputs how to achieve this.
    Regards,
    Tripti.

    Hi Vishal ,
      Thanks for your reply. I tried searching for  them but couldn't find any.
    Regards,
    Tripti.

  • I wish to modify the name of one of the field name in the sales order.

    HELLO GURRRUS,
                 i wish to modify teh name of one of the field name in the sales ordder.
    what is the procdure,path and steps involved in that.it would be of great help of me if u take some  time and suggest me.
    bye take care hav a happy and peaceful life

    Hi Sameer,
    If you want to change the name or description of the field in the Sales order,
    you have to use the userexit MV45AFZZ and use the Form USEREXIT_FIELD_MODIFICATION.
    Get the help of the ABAPer and decide where do you want to make the change in the Header or the Line items.  Accordingly give the requirements to the ABAPer.
    He will do it.
    Thanks
    Augustine Ponraj

  • Checkbox as one of the field in the internal table in the list

    Hi,
    I have a requirement of processing the certain records of the internal table for which checkboxes are selected in the list.
    The selected records need to be updated in the custom table and the unselected records need to be ignored.
    I have created the PF status and the application tool bar and a button on the tool bar.
    Then when the report is executed the list is displayed with the records with one of the field as a checkbox.
    At user-command.
    Then in the at user-command handling the button click event.
    I want to know which records are been selected and which are not.
    If some one knows please let me know.
    Thanks
    S Patel

    This is exactly what you need to do:-
    PBO
    CREATE OBJECT g_custom_container
             EXPORTING container_name = g_container.
      CREATE OBJECT g_grid
             EXPORTING i_parent = g_custom_container.
    Select data from your table
      PERFORM select_data CHANGING pt_outtab[].
    Build fieldcat
      PERFORM build_fieldcat CHANGING pt_fieldcat.
    Exclude standard buttons from the Toolbar
      PERFORM exclude_tb_functions CHANGING lt_exclude.
    Display output in ALV grid
      CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          it_toolbar_excluding = lt_exclude
        CHANGING
          it_fieldcatalog      = pt_fieldcat
          it_outtab            = pt_outtab[].
    PAI
    Get modified data
      CALL METHOD gv_grid->check_changed_data.
      LOOP AT gt_output INTO wa_output WHERE zzchkbox EQ c_x.
        MOVE-CORRESPONDING wa_output TO wa_selblk.
        APPEND wa_selblk TO lt_selblk.
      ENDLOOP.
    This method will give you all the records which are selected in the list output. Collect them and modify your custom table.
    Edited by: Rudresh Chand on Feb 28, 2010 8:26 AM

  • One of the field is disabled(input not possible) after upgrade in FPE1

    Hi ABAP Gurus,
      I am working on FPE1 Transaction Code and i just find out that after upgrade one of the field  on screen is not input possible but before upgrade we have that field as input/output  possible .
    so now we want same functionality what we have before . so which path do i need to follow because its standard screen .
    any suggestion is appreciated .
    Thanks,
    Jack
    Edited by: jack troy on Jun 24, 2009 7:36 PM

    Hi Ajay,
    Thanks for your reply . My question is can we enable field for input using transaction variant .because if i go to screen layout for FPE1 ,  i can see that this field is only output possible .
    Thanks,
    Jack

  • Importing CSV files into Multiple Tables in One Database

     I have a web based solution using Microsoft SharePoint and SQL Server that is created to centralize dat collection and reporting of program metrics used in montly reviews.
    A person from each program enters dat manual or by pushing the data using automated data import tools. The user then is able to generate reports and provide presentations to their stakeholders.
    There are are programs that are located in US and 2 that are located in Japan. All, including programs in Japan use the MS Project with a plug-in tool that allows them to auto input data. When the user click the "Send To.." button, the data goes
    in to multiple tables in one database.
    Everything is set up exactly the same for every program; however, we have discovered becase of a firewall, along with some of the different settings that the MS Project has over in Japan, the 2 program users are not able to auto import their data.
    The suggestion is to have the program users export the MS Project file into a CSV and email it. I will then take it and convert the data, such as the dates and place them on a Network Drive. There will be 2 folders, one for each program.
    I feel it will be an easy process just to load the data from the Network Drive into the same tables that are created for auto import.
    My Concerns/Questions:
    1. Should I create 1 SSIS package or should there be 2, one for each program?
    2. US and Japan program users send their data once a month. The converted files are going to be saved in the location marked with a date (ex:201402). How can i have it to where SSIS will automatically load the data every time i place new files in the designated
    folders or when i update an exsisting file?
    Can you provide an example with your suggestion please?
    I greatly appreciate the assistance!
    Y_Tyler

    Hello Vikash,
    Thank you! This will help me get started.
    There will be 2 folders, one with files with Program A data and the other with files with Program B data. All will have the same fields, just coming from different programs. You stated that I will be able to to load both in one package. Would there be two
    paths since there will be two separate folders?
    Using the example you provided, i am confident that I can create the package using one path into one table but not sure how to get the files from 2 paths (if there is) into multiple tables.
    Can you help clarify this for me?
    Thank you!
    Y_Tyler

  • How do Import a csv file that contains strings

    I have a file that contains numbers as US formmated $$$  such as $1,123,123,123  I have a perl script on one of our linux servers that creates the csv file as
    "Total Dollars","$1,123,123,123","some other string","etc"  but when I import the file into numbers
    Unnamed Table
    Average Price'
    $160
    686'
    $222
    482'
    $114
    820'
    $188
    062'
    I cant find a setting anywhere that says to ignore commas inside a string.  This works in most other applications.

    I apologize but you wrote :
    WALTER-MILANO-ITALY wrote:
    You should be now able to import the file using ; as separator or if you prefer you can do again the change  of ; with ,
    It's not a matter of preferences. The OP can't import a file whose values are separated by semi-colons.
    He must replace them by commas.
    With your scheme :
    Original datas
    'Total Dollars','$1,123,123,123','some other string','etc'
    after your step 1
    'Total Dollars';'$1,123,123,123','some other string','etc'
    after your step 2
    'Total Dollars';'$1,123,123,123''some other string''etc'
    and the datas are completly unusable
    A possible scheme would be :
    Original datas
    'Total Dollars','$1,123,123,123','some other string','etc'
    'Totals Dollars','$12,123,123,123’,’blahblah’,’etc'
    after possible step 1 (replace ‘,’ by ",")
    'Total Dollars";"$1,123,123,123";"some other string";"etc'
    'Totals Dollars";"$12,123,123,123";"blahblah";"etc'
    after possible step 2 (replace single ‘ by ")
    "Total Dollars";"$1,123,123,123";"some other string";"etc"
    "Totals Dollars";"$12,123,123,123";"blahblah";"etc"
    after possible step 3 (replace ";" by ",")
    "Total Dollars","$1,123,123,123","some other string","etc"
    "Totals Dollars","$12,123,123,123","blahblah","etc"
    This one may be imported by Numbers on thez OP’s machine.
    I don't know if these changes may be done with Perl but I know that they are easy to do with AppleScript.
    But honestly, if Perl is able to build a TAB separated values file, it would be more efficient.
    Yvan KOENIG (VALLAURIS, France) mercredi 25 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

Maybe you are looking for

  • FIFO Query to generate report Which relates the out-quantity to in-quantity

    Dear Experts, I am trying to generate a report to find out the Inward documents of Items which are issued or transfered. Items are managed with FIFO. Certain Items are serially managed and certain not. I am using the tables OIVL, OIVE and OIVQ for ge

  • MacBook won't detect Toshiba 1T external hard drive

    I just upgraded my operating system on my MacBook Pro and now my laptop won't detect my Toshiba 1T external hard drive, even though I've been using it before.  Any ideas?

  • Cannot get any ftp to work

    I can't seam to get vsftpd working, ( or any ftp daemon for that matter) my /etc/hosts.allow are correct, my /etc/services is correct, my vsftpd.conf is setup also. even nmap reports that ftp is open: PORT STATE SERVICE 21/tcp open ftp 22/tcp open ss

  • Is there SDK for import function in business view manager?

    Every time we deploy crystal objects to customers' environment, we have to import xml files one by one in business view manager. Now I'm working on a c# program(vs2005) to realize importing a batch of xml files. My design is to collect file names fro

  • What is the green bullseye in firefox next to "open menu" button?

    Just to the left of the "open menu" button there is a green target that recently showed up. If I hover over it, I get no info. I have had issues with viruses lately, and don't want to just click it to find out.