CSV Conversion Considering Edge Cases

We currently have a problem converting an internal ABAP table into a CSV file.
Example:
UserID;Name;Pet1;Pet2
D012345       Klaus Meier     Dog;Bruno      Cat"Kitty
should become
D012345;"Klaus Meier";"Dog;Bruno";"Cat ""Kitty" (<- content delimiter, escaped)
Is there a specific functional module where you can define whether to use such delimiters or not? And what would happen if there is - per accident - only one double quote in the field, can this be escaped e.g. by a second double-quote like Excel does it?
We are running on NW 7.01. Any help highly appreciated.
Best,
  Oliver

you just do
REPLACE ALL OCCURRENCES OF '"' IN my_struc WITH '""'.
then you apply separators

Similar Messages

  • CSV conversion problems in File adapter

    Hi,
    Hi,
    We had a problem with CSV conversions in file adapter.Our scenario is: IDOC>Xi>FTP(csv)
    Our target file should be show as when I open in notepad:
    "Active","1234","fdsfs","fsdfsdfs"
    "","","fsdfda"","Fsdfsfsdfsdf""12202003"
    Is this possible for put  "Double quotes" for each and every field.
    currently my conversion  file is coming like this:
    Active,1234,fdsfs,fsdfsdfs
    ,,fsdfda,Fsdfsfsdfsdf,12202003
    when I open this file in excel ..some fields data occupying next or before cells...it means mismatching the data between cells.
    probably if I put "double quotes" for each and every field then i could aviod this mismatch data presentation in different cells in excel?
    Thanks,
    PILearn

    Hi,
    When you try to open such files in Excel...if there is no space between two field even it is comma....it will take it as whole string...
    if you have fixed length...excel gives you the option either with delimiters or with fixed lengths.
    Regards.
    Akshay.
    Reward points if find useful.

  • [svn:fx-trunk] 11933: Addressing an edge case for TileList where at times the listItems array doesn 't accurately reflect a fully realized set of item renderers.

    Revision: 11933
    Revision: 11933
    Author:   [email protected]
    Date:     2009-11-18 06:55:18 -0800 (Wed, 18 Nov 2009)
    Log Message:
    Addressing an edge case for TileList where at times the listItems array doesn't accurately reflect a fully realized set of item renderers.  This can occur when the TileList row/col creation routine bails out early when it believes it has no further need to create renderers due to current height of the list itself.
    QE notes:  None
    Doc notes: None
    Bugs: SDK-24169
    Reviewer: Alex
    Tests run: List, TileList, HorizontalList, DataGrid
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24169
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as

    Due to a copy/paste glitch, some necessary spaces have inadvertently been removed.  If I could fix this, I would.

  • Selecting the data without considering any case sensitives

    Moderator message: please do not post the same question more than once
    Hi,
    I need to select the data without considering any case sensitives.
    Eg: If i enter ***JoHn****, then system need to select all currencies or amount depending on the this name.
    Please assist, many thanks.
    Sameer.
    Edited by: Matt on Nov 20, 2008 1:16 PM

    Hi,
    use cp or like in the select query
    and more over any thing given in single quotes must be in upper case to my knowledge in ABAP.
    any how try this
    select * from dbtab where name like '%JoHn%'.
    if doesnt work translate it to upper case.
    hope this this would solve.
    regards
    Ramchander Rao.K

  • [svn:fx-trunk] 10877: Fix a small syntax error in Path bounds calculations that could result in wrong bounds for edge cases involving MoveSegments .

    Revision: 10877
    Author:   [email protected]
    Date:     2009-10-05 15:23:37 -0700 (Mon, 05 Oct 2009)
    Log Message:
    Fix a small syntax error in Path bounds calculations that could result in wrong bounds for edge cases involving MoveSegments.
    Thanks go to Min for noticing the bug!
    QE notes: None
    Doc notes: None
    Bugs: None
    Reviewer: Deepa
    Tests run: checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Path.as

    orangekay wrote:
    That is absolutely unreadable.
    I agree completely. How about also providing a link to a set of input files so that we could actually run the code ourselves? Otherwise, there is no chance to debug the source code, it is just a mess.
    You might have better luck with an older version of the file. To quote the comments:
    // Modified on March 31, 2005. Initialized maxchange in nonlinvoltra() as
    // INFTY. Replaced crnmbr() by a similar, but faster routine interior().
    // Many thanks to Stuart Anderson for pointing out this shortcut.
    I suspect that the "interior" function is just plain incorrect. It doesn't matter if it runs on some other OS. Something about it is wrong and the code is so cryptic that it can't be deciphered.

  • To CSV conversion problem

    hi all,
    could you fix this problem in the File Adapter :-
    Initialization error: Conversion initialization failed with java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found:
    Parameter '.fieldFixedLengths' or '.fieldSeparator' is missing
    while trying to write XML to a CSV file.
    i've configured the FCC as:
    Structure = structs ( with 6 columns)
    struct.fieldFixedLengths 20,10,10,10,10,10
    struct.fieldSeparator ,
    struct.endSeparator 'nl'
      thanks in advance
    nikhil
    null

    I think the problem is a spelling error: you named your structure "structs" and then you refer to it as "struct".
    You have to choose one between the two (or a better one if you can find it).
    About File content conversion I suggest you to see the following links:
    Content Conversion (Pattern/Random content in input file)
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    File Content Conversion for Unequal Number of Columns
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    How to send a flat file with fixed lengths to XI 3.0 using a Central File Adapter
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    Content Conversion ( The Key Field Problem )
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    Solution to the problem encountered using Variable Substitution with XI-SP12
    /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
    I hope this will be helpfull.
    Regards,
    Salvatore

  • CSV conversion problem

    Hello,
    I'm looking for help solving the following problem. For my research I'm using a program that crawls the web, looking for particular information. The input for this program are CSV files, in which each keyword is enclosed in ' '. In Numbers this isn't problematic if I set up the Text option for the cells. When I convert it to CSV however, the first ' disappears, so that the web program is fed with the wrong information and doesn't work.
    Can anyone help me please?

    In fact it seems that two problems strike.
    (1) if the cell is not defined as text, the first single quote is dropped
    (2) if cells are defined as text, the single straight quotes are replaced by smart curly single quotes which aren't what your other program requires.
    This script takes care of that.
    As I don't know if you need double quotes, I inserted a property allowing you to enclose values with double quotes or not.
    --[SCRIPT clipboard2CSVfileWithQuotes]
    Enregistrer le script en tant que Script, Application ou Progiciel :clipboard2CSVfileWithQuotes.xxx
    déplacer le fichier créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Copiez le bloc de cellules à exporter dans le Presse-papiers.
    menu Scripts > Numbers > clipboard2CSVfileWithQuotes
    Des apostrophes seront ajoutées si nécessaire.
    Le script créera un fichier CSV dans lequel toutes les valeurs sont encadrées par des guillemets.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    +++++++
    Save the script as a Script, an Application or an Application Bundle:clipboard2CSVfileWithQuotes.xxx
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Coopy the range of cells to export into the clipboard
    menu Scripts > Numbers > clipboard2CSVfileWithQuotes
    Straight quotes will be inserted if required.
    The script will create a CSV file in which every cell value is enclosed between double quotes.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    +++++++
    Yvan KOENIG (Vallauris FRANCE)
    21 juillet 2009
    property curlyOpen : "‘" (* the 'smart' single opening quote used by Numbers *)
    property curlyClose : "’" (* the 'smart' single closing quote used by Numbers *)
    property doubleQuotesRequired : false
    (* true = enclose every value with double quotes
    false = doesn't enclose every value with double quotes *)
    on run
    try
    set enTexte to the clipboard as text
    set fName to (do shell script "date " & quote & "+_%Y%m%d-%H%M%S" & quote) & "." & "csv"
    set p2d to path to desktop
    tell application "System Events" to make new file at end of p2d with properties {name:fName}
    set enListe to paragraphs of enTexte
    repeat with r from 1 to count of enListe
    set rowR to item r of enListe
    set listeR to my decoupe(rowR, tab)
    repeat with c from 1 to count of listeR
    set itmRC to item c of listeR
    if itmRC ends with curlyClose then set itmRC to (text 1 thru -2 of itmRC) & "'"
    if itmRC starts with curlyOpen then set itmRC to "'" & (text 2 thru -1 of itmRC)
    if (itmRC ends with "'") and itmRC does not start with "'" then set itmRC to ("'" & itmRC)
    set item c of listeR to itmRC
    end repeat
    set item r of enListe to my recolle(listeR, tab)
    end repeat
    if doubleQuotesRequired then
    set enTexte to my recolle(enListe, quote & return & quote)
    set enTexte to my remplace(enTexte, tab, quote & "," & quote)
    if enTexte does not start with quote then set enTexte to quote & enTexte
    if enTexte does not end with quote then set enTexte to enTexte & quote
    else
    set enTexte to my recolle(enListe, return)
    set enTexte to my remplace(enTexte, tab, ",")
    end if
    write enTexte to file ((p2d as text) & fName)
    on error
    if my parleAnglais() then
    error "The clipboard doesn’t contain text data. Maybe you selected a Numbers sheet !"
    else
    error "Le presse-papiers ne contient pas de données texte. Vous avez peut-être copié une feuille de Numbers !"
    end if
    end try
    end run
    --=====
    on decoupe(t, d)
    local l
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local t
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to ""
    return t
    end recolle
    --=====
    replaces every occurences of d1 by d2 in the text t
    on remplace(t, d1, d2)
    local l
    set AppleScript's text item delimiters to d1
    set l to text items of t
    set AppleScript's text item delimiters to d2
    set t to l as text
    set AppleScript's text item delimiters to ""
    return t
    end remplace
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (from FRANCE mardi 21 juillet 2009 18:12:43)

  • Import CSV conversations into Whatsapp

    Is there any app that will import conversations from a CSV file, into Whatsapp?
    Thanks for helping

    Hi
    yes you could use powershell to do it
    http://www.sharepointdiary.com/2013/04/import-from-csv-file-to-sharepoint-list-using-powershell.html
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Credit check not consider in case of expired Bank Gurantee

    Dear Experts,
    We are using credit control for Bank Guarantees also, when i have created bank Guarantees(through F-49)we are giving Expiry date for BG in Due field. It is working fine for credit check for customer.
    But after expiry of BG also system considering BG amount for credit control, system suppose to not consider the BG amount since BG got already expired.
    Why system taking consideration for expired BG's for credit check?
    How to overcome the above issue?
    Useful answer will be rewarded without fail.
    Edited by: akdevavarapu on Feb 16, 2010 5:24 AM
    Edited by: akdevavarapu on Feb 16, 2010 5:36 AM

    Hi there,
    If you want your system to check for the credit limit to be checked, go to transaction OVA8, select your combination of Credit control area, credit group and risk category and press details.
    Set the field, No of days (released documents are still unchecked) to 0 or the days what u need.
    For eg. if u set the date to 10, the credit check wont happen for the next 10 days from the last checking date.
    So if u want ur system to check for credit once your BG expires, u have set the date to 0.
    Thanks
    Krish

  • Conversion from a case-sensitive to case-insensitive disk configuration.

    Being an old Unix user, I configured my disks to be case-sensitive. I've discovered that patches and updates to some applications fail due to changes in the case used for file names.
    Is there a painless way to convert a case-sensitive file system to one that is case-insensitive?

    I don't have current version of SoftRAID 4.0 but I thought that was one of its features, just as it can change the block size for arrays from 16-32-64-128k etc on the fly.
    I haven't used it, but iPartition claims to be able to convert in-place between case-sentitive and case-insensitive HFS+ formats.
    The trouble is, even then, a restore may not work properly.
    http://www.dslreports.com/forum/r19614460-Convert-hard-drive-to-HFS-that-is-not- case-sensitive

  • XML TO .CSV Conversion issue

    Hi All,
    I Developed an MDM to 3rd Party FTPscenario with FCC . The data from MDM comes as XML and i placed it at the FTP succesfully with .CSV format.
    But the issue is with tirmming of before Zeros in excel file,
    eg: The value of a field GTIN_No is 076895464 from source, but its getting placed in the excel file as 76895464.
    The before zero is mandatory as of the client requirement.
    Please suggest
    Regards,
    Raghav

    Hello Raghavendra,
    Can you include a quote ' before and after the numerical value. The Excel will then interpret this number as string from the CSV file you are creating and should solve your problem.
    Let me know if you still have issues after this solution.
    Regards,
    Nipun

  • XML to CSV conversion

    Guys,
    I got one XML file in cXML format from client which he wants me to covert into CSV file. He would like to process this file into Oracle Applications using SQL loader. He had provided me with his xml file which I am pasting below. I need your assistance to convert XML file into CSV file. I had gone through number of threads over here but nothing could work for me since my xml file is little different than usual.
    <?xml version="1.0" ?>
      <!DOCTYPE cXML (View Source for full doctype...)>
    - <cXML payloadID="2013-06-25T09:37:47+10:[email protected]" timestamp="2013-06-25T09:37:47+10:00" version="1.2.008">
    - <Header>
    - <From>
    - <Credential domain="NetworkID">
      <Identity>AN01000001000</Identity>
      </Credential>
    - <Credential domain="DUNS">
      <Identity>750412066</Identity>
      </Credential>
      </From>
    - <To>
    - <Credential domain="NetworkID">
      <Identity>751594100</Identity>
      </Credential>
    - <Credential domain="DUNS">
      <Identity>751594100</Identity>
      </Credential>
      </To>
    - <Sender>
    - <Credential domain="NetworkID">
      <Identity>AN01000001000</Identity>
      <SharedSecret>(not telling)</SharedSecret>
      </Credential>
    - <Credential domain="DUNS">
      <Identity>750412000</Identity>
      </Credential>
      <UserAgent>Corporate Express webMethods HTTP(S) client</UserAgent>
      </Sender>
      </Header>
    - <Request deploymentMode="production">
    - <InvoiceDetailRequest>
    - <InvoiceDetailRequestHeader invoiceID="9008271000" purpose="standard" operation="new" invoiceDate="2013-06-25T00:00:00+10:00">
      <InvoiceDetailHeaderIndicator />
      <InvoiceDetailLineIndicator isTaxInLine="yes" />
    - <InvoicePartner>
    - <Contact role="remitTo">
      <Name xml:lang="en">XYZ Limited</Name>
    - <PostalAddress>
      <Street>PRIVATE BAG 16</Street>
      <City>Alexandria</City>
      <State>NSW</State>
      <PostalCode>1435</PostalCode>
      <Country isoCountryCode="AU">AU</Country>
      </PostalAddress>
      </Contact>
      <IdReference identifier="94000721000" domain="gstID" />
      </InvoicePartner>
    - <InvoicePartner>
    - <Contact role="soldTo">
      <Name xml:lang="en">Customer Name</Name>
    - <PostalAddress>
      <Street>PO BOX a170</Street>
      <Street>ATTN ACCOUNTS PAYABLE</Street>
      <City>SOUTH City</City>
      <State>VIC</State>
      <PostalCode>3205</PostalCode>
      <Country isoCountryCode="AU">AU</Country>
      </PostalAddress>
      </Contact>
      <IdReference identifier="78061067678" domain="gstID" />
      </InvoicePartner>
    - <InvoicePartner>
    - <Contact role="billTo">
      <Name xml:lang="en">Customrs Name</Name>
    - <PostalAddress>
      <Street>PO BOX a170</Street>
      <Street>ATTN ACCOUNTS PAYABLE</Street>
      <City>SOUTH  City</City>
      <State>VIC</State>
      <PostalCode>3205</PostalCode>
      <Country isoCountryCode="AU">AU</Country>
      </PostalAddress>
      </Contact>
      <IdReference identifier="78061067678" domain="gstID" />
      </InvoicePartner>
    - <InvoiceDetailShipping>
    - <Contact role="shipFrom">
      <Name xml:lang="en">Staples Australia Pty Limited</Name>
      </Contact>
    - <Contact role="shipTo" addressID="VIC">
      <Name xml:lang="en" />
    - <PostalAddress>
      <Street>Clothing Store,Blamey Barracks,Buil</Street>
      <City>KAPOOKA</City>
      <State>NSW</State>
      <PostalCode>2661</PostalCode>
      <Country isoCountryCode="AU">AU</Country>
      </PostalAddress>
      </Contact>
      </InvoiceDetailShipping>
      <Extrinsic name="documentType">Tax Invoice</Extrinsic>
      </InvoiceDetailRequestHeader>
    - <InvoiceDetailOrder>
    - <InvoiceDetailOrderInfo>
    - <OrderReference orderID="SER_6776">
      <DocumentReference payloadID="20132721.5508.1900762829@IPOS02" />
      </OrderReference>
      <SupplierOrderInfo orderID="8855712905" />
      </InvoiceDetailOrderInfo>
    - <InvoiceDetailItem invoiceLineNumber="000110" quantity="1.000">
      <UnitOfMeasure>BX</UnitOfMeasure>
    - <UnitPrice>
      <Money currency="AUD">21.82</Money>
      </UnitPrice>
    - <InvoiceDetailItemReference lineNumber="11">
    - <ItemID>
      <SupplierPartID>18839409</SupplierPartID>
      </ItemID>
      <Description xml:lang="en">BIC Cristal Easy Glide Medium Black Box</Description>
      </InvoiceDetailItemReference>
    - <SubtotalAmount>
      <Money currency="AUD">21.82</Money>
      </SubtotalAmount>
    - <Tax>
      <Money currency="AUD">2.18</Money>
      <Description xml:lang="en">GST</Description>
    - <TaxDetail purpose="tax" category="gst" percentageRate="10.000">
    - <TaxAmount>
      <Money currency="AUD">2.18</Money>
      </TaxAmount>
      </TaxDetail>
      </Tax>
    - <GrossAmount>
      <Money currency="AUD" />
      </GrossAmount>
      <Comments xml:lang="en" />
      </InvoiceDetailItem>
      </InvoiceDetailOrder>
    - <InvoiceDetailSummary>
    - <SubtotalAmount>
      <Money currency="AUD">21.82</Money>
      </SubtotalAmount>
    - <Tax>
      <Money currency="AUD">2.18</Money>
      <Description xml:lang="en">GST</Description>
      </Tax>
    - <SpecialHandlingAmount>
      <Money currency="AUD">0</Money>
      </SpecialHandlingAmount>
    - <ShippingAmount>
      <Money currency="AUD">0</Money>
      </ShippingAmount>
    - <InvoiceDetailDiscount>
      <Money currency="AUD" />
      </InvoiceDetailDiscount>
    - <NetAmount>
      <Money currency="AUD">24.00</Money>
      </NetAmount>
    - <DueAmount>
      <Money currency="AUD">24.00</Money>
      </DueAmount>
      </InvoiceDetailSummary>
      </InvoiceDetailRequest>
      </Request>
      </cXML>
    Waiting for your reply. Thanks.
    -Sunil

    As far as your clarification around "What CSV looks like?"  I must tell you this XML has Header and Details Data it should display Header and Line information in a single line of CSV.
    It's not that simple.
    For example, take the <InvoicePartner> element, there are 3 occurrences in the sample XML. How do they translate into csv format ? All three on the same line, or each in its own new line (potentially generating lots of redundancies in the process) ?
    I encourage you to do this exercise yourself first : try to build your expected csv output "manually" from the sample XML and see if the result makes sense.
    If it does then post it here and we'll see how to implement the transformation.

  • Conversion of lower case letters to upper case in ABAP

    Moderator message: when you've got your answer to this, find out how to do it the other way for the subject of your posts!  Please do not use ALL CAPITALS as subject
    Hi Experts
        How to convert lower case letter to upper case letter in ABAP
    Edited by: Matt on Feb 13, 2009 6:55 AM - subject changed

    Hi,
    Check the below syntax
    TRANSLATE text {TO {UPPER|LOWER} CASE}
                 | {USING pattern}.
    Regards,
    Anki Reddy

  • How to read/insert MS .xls  record into Oracle without .csv conversion etc.

    i really have this challenge to download .xls file at oracle level. In other word no apache utility like Sheet etc. need to use. Any thin at oracle level is permitted though. E.g. stored procedure/ function etc.
    File is as such in .xls format. Not text or .csv or any other delimitered.
    Thanks

    Can you explain exactly why these limitations are in place? That would really help us figure out whether any of the options we might be able to suggest would work for you. A few options off the top of my head:
    - There are various Java libraries that can parse at least some reasonable subset of Excel formatting. I'd expect that you could probably load one of those into Oracle and write a Java stored procedure that would parse the file. Of course, I'm not sure whether that falls into your "at Oracle level" bucket or into your "no Apache utility" bucket.
    - Oracle APEX has various Excel upload utilities, but that requires the use of APEX which might not be trivial to integrate with an existing application.
    - Heterogenous Services with Generic Connectivity would allow you to create a database link over ODBC to an Excel file and to query the Excel data via SQL. That requires, though, that there is an ODBC DSN for the Excel file and probably requires that your Oracle database is on Windows.
    Justin

  • Convert FMB to XML File on Unix

    Hello,
    I want to convert a FMB-File to XML in my HP-UX-Middletier-Environment.The Script frm2xml.sh is only shipped with IDS.
    Can someone upload the frmf2xml.sh from a linux or Solaris IDS-Enviroment?
    Robert

    So if we were to keep text-based source files, the process would have to be:
    - check-out to local working copy
      - convert XML to FMB
        - make changes using Forms Developer
      - convert FMB to XML
    - commit to svn
    I'm concerned about the side-effects of the conversion process (edge-cases, incompatibilities), and I also expect that even with some automation, the above will be a pretty slow process that will slow the team down. I guess we'll probably stick with fmb.
    I guess as a compromise, it may be worthwhile generating the xml or fmt alongside the fmb and committing both. At least we'd then have a text-based file to compare revisions with. So the process then becomes:
    - check-out to local working copy
      - make changes using Forms Developer
      - generate XML from FMB
    - commit both to svn
    I'm still baffled as to why Oracle has chosen a binary source format, even 15 years ago. This basically precludes a vast number of tools and techniques that are essential to the software craft :(

Maybe you are looking for