Split at comma with " characters

I am uploading a comma separated file using the the SPLIT AT ',' command.  But on field contains the following string "RN 90055358,9005", which should be interpreted as one field, however it is splitting this field into 2 fields. 
I thought the quotes (") identified the field was to be treated as a string.  How can I ensure that this field is not split?

It would if you were importing it to Excel, but not in ABAP.
You option, if this field always has a comma in it would be to give 2 work fields for your split and then concatenate them back
together into the final field.
You could also split the string into a table and then use describe to know how many fields were returned. 
If they are X you know there is no comma in that field.  If there is X+1 you know this field had a comma and needs to be
concatenated into the final table.
Also, the " (double quotes) will be added to the field.
TRANSLATE and CONDENSE may help you there or
TRANSLATE and SHIFT LEFT
Hope this helps

Similar Messages

  • Is there any inbuilt function to split a comma seperated text

    Dear Friends,
    Is there any inbuilt function to split a comma seperated text for inserting the values thus split in to a table.
    Text Ex: Mango, Orange, Pinapple, Jack Fruit
    Output: Mango
    Orange
    Pineapple
    Jack Fruit
    Thanking you,
    With regards,
    Franklin

    Using DBMS_UTILITY.COMMA_TO_TABLE:--
    DECLARE
    l_tab dbms_utility.uncl_array;
    l_tablen number;
    BEGIN
    dbms_utility.comma_to_table('A,B,C', l_tablen, l_tab);
    dbms_output.put_line('TABLE LENGTH : '|| l_tablen);
    dbms_output.put_line('TABLE COUNT : '|| l_tab.COUNT);
    for i in 1..l_tablen
    loop
    dbms_output.put_line(l_tab(i));
    end loop;
    END;
    source --google.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Replace comma  with a character only if it is enclosed in single quotes

    I have a string
    String stmt = "insert into ABC values (Default,'ABC','1234,xyz,abc');{code}
    expected the result is
    insert into ABC values (Default,'ABC','1234~xyz~abc')
    I want to replace only those commas with a ~ if they are part of the string enclosed in a pair of singe quotes.
    i am trying something like
    {code}String regex = "\'\\w+(,)+\\w*,*\\w*\'+\1";
    String output = stmt.replaceAll(regex,"~");
    {code}
    but its not working
    Please help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    LearningMachine wrote:
    No, that's not what I am trying to do.
    This is not an insert into a sql, I have to parse a DML (SQL Script) and get table name, values out of it, but I can't split the string with commas.
    Then you should find or build a parser.
    Unless the DML is very well constrained or the set is very small and will remain so, by the time you finish mucking around with all the possibilities attempting it with regexes you will have a parser but not a very good one.

  • How to split a string with linefeed character ( LF ) as a delimiter in VB6?

    Hi. I am writing a small program in VB 6.0. 
    I have a string named Data and it contains few characters along with <LF> in it. ( <LF> is a new line/line feed character).
    I want to split this string with <LF> as delimiter and store the tokens in an array. I tried with split function and its giving me type mismatch error. Can anyone tell me how to do it?
    I am giving the pseudo-code below.
    Dim Data as string
    Data = "hello, how are you<LS>good morning guys <LS> hi"
    Dim strarray() as stringMsgbox(Data)
    strarray = split(Data, "<LS>")
    When i see the Data in message box before split function, it shows up in different lines like this:
    hello, how are you
    good morning   guys 
    hi
    I want the final array strarray to be like this:   strarray(0) = "hello, how are you"
    strarray(1) = "good morning   guys "
    strarray(2)  = " hi"
    The spaces can be as it is. Just i need the string to be delimited wherever <LS> is there.
    Please help me as soon as possible. Though it is small one, i am stuck here.
    Thanks in advance,
    Satya.

    Hello,
    This forum is for VB.NET, please check the following resources
    http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/6a0719fe-14af-47f7-9f51-a8ea2b9c8d6b/where-to-post-your-vb-6-questions?forum=vbgeneral
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • How to split a string with regular expression

    Hi.
    I need to split a string with a regular expression.
    Example
    String = "this is; a test";rune haavik;12345;
    And I want the output to be:
    "this is; a test"
    rune haavik
    12345
    If I use this code:
    private void test1()
    String str = "\"this is; a test\";rune haavik;12345;";
    int i=0;
    String[] tmp = str.split(";");
    while(i<tmp.length)
    System.out.println(tmp);
    i++;
    Then it splits also in the "" text.
    Regards
    Rune haavik

    Rune haavik:
    The most effective way to achieve the end result is, I believe, to read the characters one by one, using a flag that indicates if we are inside quotation or not.
    Well, if we are in a mind game, then the following should do.
           String[] tmp = str.split(";(?![^\"]*\";)");

  • Language:  Filename with characters for arabic turns question mark

    Language: Filename with characters for arabic turns question mark
    OS: Solaris 9
    Machine: Sun-Fire 25K
    There is an adobe distiller software that is configured and a java apps. There are postscript files that are being converted to .pdf format using the adobe distiller. Using the GUI (using the Exceed; for remote access), when they use GUI to convert the postscripts to pdf files, the long filenames have the corresponding characters for arabic reading purpose. This is OK.
    When we use the windows RUN to telnet the server and convert the postscripts to pdf, it gives a question marks characters in the filenames ( this; is a sample; filename; ?? ??? ??; right.pdf )
    We are not sure now if we have to add a package of arabic or a patch to resolve this problem.
    Message was edited by:
    yurioira32
    Message was edited by:
    yurioira32

    Solution found, I'll post the work around to those who might encounter the same problem.
    Somewhere in the layers of technology (webwork or weblogic I'd guess), the servlet response is encoded into UTF-8 regardless. The encoding in the database was ISO-8859-1. Sending ISO encoded bytes by UTF-8 caused the conflicting character codes (anything above 127) to show up as undefined.
    The fix is to decode the input byte array into ISO-8859 string, then encode that string into UTF-8, which can be send by Weblogic.
    isoConvert = new String(buf, "ISO-8859-1");
    out.write(isoConvert.getBytes("UTF-8"), 0, isoConvert.getBytes("UTF-8").length);

  • F-32: document Splitting generates lines with alternating +/-signs

    Hi Sap Guru,
    While clearing the Customer in F-32, user is getting  error as document Splitting generates lines with alternating +/-signs. It is happening only for few customers.
    Please advice me what could be the reason for the same.
    Thanks,
    Manya

    Hi
    Could you explain what the entrie it is generating (you can simulate and observe) and for which accounts it is behaving ubnormal.
    with regards
    siva

  • Text to speech not working with characters such as quotes? Any ideas

    text to speech not working with characters such as quotes? Any ideas

    Hi linz-kirby
    I posted this (link) https://discussions.apple.com/message/27015600?ac_cid=op123456#27015600

  • Issue with characters like u0151 in maintaining text

    Hi,
    When characters are entered as per HU language, we face trouble with characters like ő Ő into text fields like in sales order. As soon as this letter is entered, it is changed to 'O' as in EN language.
    changing -> Options-> Character set -> Central European, makes the display  ő as  ő .
    1. Is this the permanent solution for this problem ? or do we have any better idea ? 
    2. Does this character set do any command in printing (SAP Scripts/ Smart Forms / PDF) ?
    Please let me know your thoughts.
    Thanks
    Seema

    Please post ASP.NET related questions in the ASP.NET forums:
    http://forums.asp.net

  • Problems with characters like "Á", "É"

    Hi, I'm having trouble when reading data with characters "&Aacute;", "&Eacute;", "&Ntilde;" from a database. If I use this:
    stmt = this.conexion.createStatement ();it works fine, but of course cannot access the records in the ResultSet but with method next ().
    As I wanted to use absolute (), first (), etc. I wrote that:
    stmt = this.conexion.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);but when I try to read for example the word "P&Eacute;REZ", I get the word "0x50C38952455A".
    Can anyone help? Thanks in advance.

    This is my connection code:
          Class.forName("oracle.jdbc.driver.OracleDriver");
          conn = DriverManager.getConnection(url, login, password);The code that works:
    (1)
        stmt = conn.createStatement ();The code that doesn't:
    (2)
        stmt = conn.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);Then, the same code to execute the query:
        rs = stmt.executeQuery ("SELECT MY_VARCHAR_FIELD FROM MY_TABLE");And to retrieve the value:
        String myValue = rs.getString ("MY_VARCHAR_FIELD");The odd thing is that before using a scrollable ResultSet (code snippet (1)), this worked perfectly. But, since I changed to code snippet (2), it doesn't for those characters.

  • Calculated formula for replacing a comma with a Semicolon in a text field

    I need help replacing a comma with a Semicolon in a text field.
    I have a field that has names separated by commas.  
    Ex: Dog, Cat, Bird, Horse, Eagle, Worm, Snake
    I would like a calculated column that converts the field into: Dog; Cat; Bird; Horse; Eagle; Worm; Snake
    I figured out the first three positions (Dog, Cat, Bird,) but I can't figure out the rest.
    Using the formula below.
    =REPLACE((REPLACE((REPLACE([Title],SEARCH(",",[Title]),"1"," ; ")),SEARCH(",",(REPLACE([Title],SEARCH(",",[Title]),"1"," ; "))),"1"," ; ")),SEARCH(",",(REPLACE((REPLACE([Title],SEARCH(",",[Title]),"1","
    ; ")),SEARCH(",",(REPLACE([Title],SEARCH(",",[Title]),"1"," ; "))),"1"," ; "))),"1"," ; ")
    Please help

    check the similar post
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/66e2ae2a-4da9-4c58-a8bb-cf46b1bf448f/calculated-column-to-replace-commas?forum=sharepointgenerallegacy

  • Document splitting generates lines with alternating +/- signs

    Hi,
    While trying to post GR through MIRO, I am getting a message like "Document splitting generates lines with alternating +/- signs", please clarify why this error is coming.
    But I am able to post the moment I am deleting a small amount from planned delivery cost field. Why this is happening, can anyone explain pls.
    Regards,
    Ab

    Hi
    We have the same message but we want to clear two FI invoices
    Did you ever find out what caused this message?
    Regards
    Paddi

  • I have a kodak printer hero 5.1, it prints or scans  2 or 3 jobs then loses comms with mac although the wifi light is still on. I tried to uninstall software but when I go to printers folder "no such folder message" . Any advice appreciated.

    I have a Kodak printer hero 5.1, it prints or scans 2 or 3 jobs then loses comms with mac although wifi light is still on. I have tried  to remove printer by deleting in preferences but when i try to go to printer folder " no such folder " message appears. Any advice appreciated.

    Log in to the Developer forum. You will find instructions on how to install the lastest beta. Your problem is the beta you have installed has expired. All of them did on October 5; you will find hundreds of threads discussing this. If you have a beta it is assumed that you will continue as a beta tester, so a simple update using iTunes will not work.
    If you no longer want to be a beta tester install the GM 7.0.2 by restoring from iTunes using DFU mode.

  • Error while doing commit with UnitOfWork

    Hi all,
    I get the following error while trying to do a commit with Unit of Work:
    I'm trying to Insert a Row into the table here.
    EXCEPTION DESCRIPTION: java.sql.SQLException: DSRA9350E: Operation Connection.commit is not allowed during a global transaction.
    INTERNAL EXCEPTION: java.sql.SQLException: DSRA9350E: Operation Connection.commit is not allowed during a global transaction.
    ERROR CODE: 0LOCAL EXCEPTION STACK:
    EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: DSRA9350E: Operation Connection.commit is not allowed during a global transaction.
    INTERNAL EXCEPTION: java.sql.SQLException: DSRA9350E: Operation Connection.commit is not allowed during a global transaction.
    ERROR CODE: 0
         at oracle.toplink.exceptions.DatabaseException.sqlException(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.commitTransaction(Unknown Source)
         at oracle.toplink.publicinterface.Session.basicCommitTransaction(Unknown Source)
         at oracle.toplink.threetier.ClientSession.basicCommitTransaction(Unknown Source)
         at oracle.toplink.publicinterface.Session.commitTransaction(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitTransaction(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commit(Unknown Source)

    Are you trying to make use of TopLink's JTS integration for the UnitOfWork?
    How are you acquiring the UOW in code?
    non-JTS, make sure to use session.acquireUnitOfWork()
    for JTS, session.getActiveUnitOfWork() and never call uow.commit() since TXs are method based in an EJB.
    Also, for JTS - ensure you tell TopLink's session you are using an external TX controller in the sessions.xml, just consult the examples that install with TopLink for a sessions.xml that makes use of external TXs.
    Darren

  • Repalce comma with Space in Webi report.

    Hi Experts,
    My address Column in Webi report is showing data is like :
    Address (this is the field coming for BW)
    House No1,Flat J10,New Delhi,INDIA.
    Can we replace Comma with the space so that the ablove data would be like :
    House No1 Flat J10 New Delhi INDIA.
    Thanks.

    Hi Abdi
    Use the formula
    = Replace("House No1,Flat J10,New Delhi,INDIA";",";" ")
    then you will get
    House No1 Flat J10 New Delhi INDIA.
    Use the object in place of Text
    =Replace([Address];",";" ")
    Regards,
    Mahi

Maybe you are looking for