How to ignore the , within ( )???

hi guys,
i am currently using java class to read CSV files.
my example code is
String str = dataFile.readLine();
String[] words = str.split (",");
i do not wish to take the , within brackets to be splitted up as in (today,tomorrow), after splitting them i still want them to stick as (today,tomorrow).
for example if the above String str is "(today,tomorrow),yesterday,nextday
after splitting i want the output to be:
(today,tomorrow)
yesterday
nextday
is it possible to do it? anyone help?? thanks!

hmmm issit possible state an example of the algorithm?Use an int instead of the boolean.
Simply loop over the string. If you find an opening bracket, increment the int. If you find a closing bracket, decrement the int. Don't let the int become negative. If you find a comma, cut the String using substring if the int is 0 (adding the substring to a list, and replacing the String you're working on with the remainder, also resetting the loop counter), otherwise ignore.

Similar Messages

  • How to Ignore  the signal?

    Insert a number if the number of digits of that number is greater than its average return true else false.
    So what i'd like to know , (and btw sorry about the other questions) how can it ignore the signal ?
    e.g: number_aux = 53 -> this will be: Number of digits: 2
    Media = (5 +3) / 2 = 4
    ( 2 < 4 ) then return false. now i'd like to find a way to insert -53 (negative) and the output must be the same (false) ignoring de signal "-"
    here is my code:
    In this code if u inserted a negative ( -6 or -53) the output is always true because e takes in mind the signal . How do i tell him to ignore it?
        System.out.println.... 
          int number _aux =Integer.parseInt(... ....etc
                                              int sum = 0;
              int count = 0;
              int media;
              while (number_aux != 0){
              int digit = number_aux % 10;
              number_aux  /= 10;
              sum += digit;
              if(number_aux  >= 0) count++;
              media =(int) (sum / count);
              return (count > media);thank you so much.
    Josh

    I already used my brain LOLO , if new the answer i
    would not be here ask for help lol.
    shiver You forgot to add three or more exclamation marks.
    give me a hint , how to ignore the signal without
    that method ( using my code)If I'd give you any number, how would you do it? What would there conditions and formula be? Think about that. Programming isn't magic. It's finding a step-wise solution to a problem and writing it down.

  • How to ignore the iOS 7.0.2 update on iPhone 5

    I do not wish to download the iOS 7.0.2 software update on my iPhone 5.
    How do I stop it reminding me? I no longer want a permanent red encircled 1 on my settings icon.
    Thanks for your help.

    I don't think you can get rid of it.  I'm not switching to iOS 7 either so I've learned to ignore the red encircled 1.  Good luck!

  • How to ignore the password policy in a custom workflow?

    Hi,
    We have a custom workflow which is called via SPML to provide 'Administrator Change Password' functionality in a portal.
    Our password policy sets the String Quality rules and Number of Previous Passwords that Cannot be Reused. But we like to bypass the password policy when the password administrators (who have a admin role with a capability - 'Change Password Administrator'). At least, restriction ' Number of Previous Passwords that Cannot be Reused' need to be ignored (But password need to be added to the history... cannot disable adding passwords to history).
    Please advice me how it could be achieved?
    The workflow steps:
    1. Checkout 'ChangeUserPassword' view for the user as an administrator
    2. Set the new password in the view, set true to view.savePasswordHistory
    3. Set password on the resources
    4.Checkin the view
    Thanks
    Siva

    Thanks eTech.
    My main goal is to skip the password history check (new password can't be a last used 10 passwords) when admin change password workflow is launched. As you suggested , I created a special password policy exactly as our regular password policy excluding "Number of Previous Passwords that Cannot be Reused" setting.
    Then before change the password of a user as admin, special policy is attached , password changed, and user's password policy is reverted back to regular one. The issue is, as the special policy does not enforce the password history check, the whole password history of the user is wiped out from the user object when the password is changed by admin change password workflow. We don't want this to happen.
    Please guide me whether is anyway to achieve just ignoring the password history without any other impact on user.
    Is adding passwords to user object's password history list is triggered by "Number of Previous Passwords that Cannot be Reused" setting of the password policy??
    Thanks
    Siva

  • How to ignore the material with error in costing run ck40n

    Hi
    Pls, advice how to ignore parent material form costing run if the components of that material have errors. I need to run the costing run excluding erroneous parent item. Is any configuration on this..
    Pls help..
    K

    Hi Kesharika Goona... 
    If you want to exclude any material from Costing Run, there are two ways...
    1. Go to Material Master, Costing1 view, take the check box "Do Not Cost". If you opt for this check box, the system will not consider this material for costing.
    2. Where you run the standard cost estimate in CK40N, once you save you costing run with the parameters like Costing Variant etc, When you select the "Parameters" agains the Flow step of "Selection", you will be asked to give the inputs like Material Number, Plant etc.
    There, against the Material Number, on the extrem right side, you will see a arrow, press that arrow, and there you can see a tab "Exclude Single Values". There you have to give the material number which you want to exclude from the costing run press "Execute" icon on the botoom-left corner of that pop-up window..
    If you still face problem, pls revert back
    Srikanth Munnaluri

  • How to ignore the first row  in sender file

    I would like to ignore the first row in each file in the sender channel - how can i do it?

    Hi
    Check this,
    As he said give Document Offset = 1
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    Also check this forum
    Re: Supress Column Heading - File Content Conversion in Sender Adapter
    Thanks,
    Prakash

  • How to ignore the DTD in an XML file

    I am using XMLReader as
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    to parse an xml document. The XML has a <!DOCTYPE ....> in it which specifies a dtd file. If I do not have the dtd file on my local machine, the parser will fail. How can I tell the parser to ignore the <!DOCTYPE..> line, since I do not want it to validate against the dtd anyway?
    Thanks.

    just comment out the <!DOCTYPE> element and you will not have any problem and moreover the default behaviour of xerces is not to validate but see the well formedness .If you want to validate the xml document then do this
    parser.setFeature("http://xml.org/sax/features/validation" ,true);
    this will validate.
    hope this will help you

  • How to ignore the column header in GUI_UPLOAD

    Hi,
    I am trying to use GUI_UPLOAD to upload data from text file into a table. However there is no parameter to ignore the column headers in this function. how can i set to ignore the column headers in this function?

    Check the function module documentation and also refer to the parameter: HEADER_LENGTH
    Length of Header for Binary Data
    Description
    Specifies the length of the header information. You must only set this parameter if the file type is 'BIN'. The default value '00' means that there is no header in the file.
    Default
    '00'

  • How to ignore the popup message in TCD mode

    Hi All,
    I'm relatively new to all this. Could anyone kindly show me how to ignore those pop up message (which requires click 'yes' 'no') during the TCD recording and replay?
    The trouble I'm having at the moment is that depending on the effective start date, transaction asks either:
    1) Do you want to delimit the existing record in popup window
    2) Do you want to delete the existing record in popup window
    3) record created - no popup
    What I want to achieve is that regardless of any of these messages, I still want the transaction to complete and having data updated.
    Many thanks in advance.

    Hello,
    You can Ignore the message if the message is of following types:
    If no message type is given for the rule with this mode in column MSGTYP, all application log messages are ignored.
    If a particular message type (A, E, I, S, W, X) is specified, application log messages with exactly this type are ignored. If you want several message types (but not all) to be ignored, specify several rules with this mode and the message type to be ignored in each case
    Please refer the below link:
    http://help.sap.com/saphelp_nwpi711/helpdata/en/49/6f57112c293b5be10000000a42189b/frameset.htm
    Hope the data was useful
    Regards,
    Swetha

  • How to ignore the customer with delete stamp when customer identification

    Hi Expert,
       In customer identification of the call center, SAP standard does not ignore the customer which has delete stamp. From our biz, we don't want to catch them when corresponding customer call. And we will create a new customer with the phone number. How can I ignore and create the new customer?
    BRs
    Liu Bo

    Hi,
    open in transaction BSP_WD_CMPWB the component ICCMP_BP_SEARCH.
    Go to View BuPaSelectCustomer
    Go to the IMPL class.
    Redefine method DO_PREPARE_OUTPUT to filter out the customers you don´t want which means delete them from the BOL collection.
    Kind regards
    Manfred

  • How to ignore the empty file using Receiver file adapter with Coma separato

    Hi,
      I am trying to create the .csv file at the receiver but when there is no data I wan to ignore the file even I do not want to create the file with comma also (I just went and check in my file system created with commas)
    Source1 -> T1
           T1
            -> S1
                  ->Field1
                  -> Field2
    Because I am using receiver side FCC populating with empty node
    Based on condition T1 is populating when condition fails I am populating target T1 and structure elements are mapped with constant. 
    Ex: Target payload when condition failed below data is populating ..
    In this I want to ignore creating the file.
    <T1>
    <S1>
    <Field1/>
    <Field2/>
    </S1>
    </T1>
    Here Is the my content conversion parameters,
    S1.fieldNames - Field1,Field2
    S1.fieldSeparator - ,
    S1.endSeprator u2013 u2018nlu2019
    I used processing tab u2018Ignoreu2019 option id did not worked. Appreciate your help. 
    Regards,
    Venu.

    Hi Raj,
       I went my receiver mapping signature tab I chagned occurance from 1 to 0..1
    then my mapping got lossed now message type level I put the condition. When my condition not satisfy I am not creatin gthe target node itself.(I mean here message type) Messages ->message1 only is creating..
    but in SXMB_MONI below error I am getting..
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="MAPPING">GENERIC</SAP:Code>
      <SAP:P1>Split mapping created no messages</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>Split mapping created no messages</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Thanks for your response.
    Regards,
    Venu.

  • How to ingore the , within ( ) when i do String.split(",")??

    hi guys,
    i am currently using java class to read CSV files.
    my example code is
    String str = dataFile.readLine();
    String[] words = str.split (",");
    i do not wish to take the , within brackets to be splitted up as in (today,tomorrow), after splitting them i still want them to stick as (today,tomorrow).
    for example if the above String str is "(today,tomorrow),yesterday,nextday
    after splitting i want the output to be:
    (today,tomorrow)
    yesterday
    nextday
    is it possible to do it? anyone help?? thanks!

    Java does not have an API to do this, also its not fair to ask that. You may need to write your own code to do it. I think its simple as well.
    First split on "," and then pass through the array and form the string if the string startswith "(" by appending the next strings untill u get a string which ends with ")".
    VJ

  • How to ignore the selection criteria temporary page in print

    Hi Experts,
    I use 2007A and when i would like to print example a Trial Balance then the system prints the selection criteria on the first printed page .
    How can I delete or ignore this option? There's no need for this print.
    I was searching in help files but with no success.
    Thanks,
    Eszter

    In Administration > System Initialization > Print Preferences > General Tab
    There is a checkbox for "Print SAP Business One Generation Message"
    Uncheck it to not print the first page with selection criteria.
    Hope this was what you were looking for.

  • How to Ignore the errors while exporting

    Hi ,
    i am trying to import a dump using imp command. Out of 10000 user objects, 5000 objects has got imported successfully. Meanwhile because of a LAN failure, import was not able to continue. And again i tried with import the same. System is trying to import each and every row in table, and the log file is populated with all unique constraint errors. Is there a way to suppress these errors or else the best way is to drop all objects and import again. This is my import command. Kindly advice me.
    USERID=bditest/bditest@aspac
    FILE=D:\dump112\first10022009.dmp
    FROMUSER=BEIFLEX
    TOUSER=bditest
    LOG=D:\logbdi
    IGNORE=Y
    STATISTICS=NONE
    compile=N
    BUFFER=1000000

    One of the options would be carry out a table level import (you could generate the list of tables from the dump file using SHOW & LOGFILE options).
    Other one, as you have mentioned, would be to drop the associated schema (with CASCADE option)- with the assumption that these 5000 objects which were imported are the only objects in this schema - and then run the import again. Better to initiate the import from the server to avoid such problems :-)
    And, please post the queries in appropriate sections. This forum deals with the issues related Oracle software downloads.

  • How to ignore the first row in a csv import

    Hello
    This is the file we want to  add to the datamodel:
    https://www.mediafire.com/?a9xrwrwu79whu18
    (BTW this is the csv output from a neat & free software called Jstock)
    Here is an image of the problem:
    As you can see they add automatically a timestamp in the A1 cell ruining the possibility of a clean import.
    Can anyone help with a query to fix this and get the real headers?

    Hi NicoPer,
    To follow your M code. You have  this lines  #"First Row as Header" = Table.PromoteHeaders(Source).
    This mean you use first line ( the line include "timestamp=1415926728041" ) to make
    table header. So you no need to use Table.Skip function. You just use one more Table.PromoteHeaders to make second line to your table header. Below is your code:
    let
        Source = Csv.Document(File.Contents("C:\PATH\JSTOCK.csv"),null,null,null,1252),
        #"First Row as Header" = Table.PromoteHeaders(Source),
        #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"timestamp=1415926728041", type text}}),
        FirstRowAsHeader = Table.PromoteHeaders(#"Changed Type")
    in
        FirstRowAsHeader
    Regards,

Maybe you are looking for