Removing comma (,) from string

Hello Friends,
I have a string something of this nature
Sting : ',3456,45454,,45454,'
Need to have just comma seperated value : '3456,45454,45454'
Tried with replace but getting - '34564545445454'
select replace ( ltrim(RTRIM(replace(',3456,45454,,45454,', ',,', ','),',')),',', '') from dual;
Appreciate your help .
Thanks/Kumar

Hi, Kumar,
kumar73 wrote:
Hello Friends,
I have a string something of this nature
Sting : ',3456,45454,,45454,'
Need to have just comma seperated value : '3456,45454,45454'
Tried with replace but getting - '34564545445454'
select replace ( ltrim(RTRIM(replace(',3456,45454,,45454,', ',,', ','),',')),',', '') from dual;Do you want to remove ','s at the beginning of the string, but leave them in the other places?
If so:
LTRIM (string, ',')LTRIM removes the given character(s) from the <b>L</b>eft side (that is, the beginning) of string. That's all you want here. (Was your string generated by SYS_CONNECT_BY_PATH? This is a very common problem.)
RTRIM removes the given character(s) from the <b>R</b>ight side (that is, the end) of string. I don't think you want that; you certainly don;'t need it in the example you gave.
REPLACE removes the given characters anywhere in the string. You definitely don't want that. If you did, there would be no point in also using LTRIM or RTRIM.

Similar Messages

  • How to remove the comma from string

    Hi,
    I Have string like below :
    String some1="123,44.22";
    I want to remove comma from string and final output should be 12244.22.
    public class getOut{
    public static void main(String args[]){
    String some1="123,44.22";
    getChars(int 0,some1.length(),char[] dst,0);
    can somebody in the forum give me idea how to remove comma from the String and
    have a string without comma.
    Thanks
    Jack

    int idx = oldString.indexOf(',');
    if(idx >= 0)   
          newString = oldString.substring(0, idx) + oldString.substring(idx + 1);or for jdk 1.4 and later
    str = str.replaceAll(",", "");

  • Remove "&" charachter from string

    Hi,
    Please inform me how can i remove the & from string.
    i try this but not working.
    SELECT REGEXP_REPLACE(’raise the level of &performance, creativity',’&','') COL1 FROM DUAL;
    Also i want to remove any special character from statement.
    many thanks

    Ayham wrote:
    i try this but not working.
    SELECT REGEXP_REPLACE(’raise the level of &performance, creativity',’&','') COL1 FROM DUAL;Are you getting any error?
    SQL> set define off
    SQL> SELECT REPLACE('raise the level of &performance, creativity','&') COL1
      2  FROM DUAL;
    COL1
    raise the level of performance, creativity>
    Also i want to remove any special character from statement.
    Search the forum..
    Sample:Re: How to find Special Characters in a single query
    Edited by: jeneesh on Sep 17, 2012 12:26 PM

  • Removing commas from report result

    Hello gurus,
    Is there a way to remove commas from data values in the BEx reports?
    I used NODIM() to remove $ signs and units. We need to remove the commas as well.
    Thank you,
    Malli

    hi,
    in query properities you should have option to show unit on the top of column only and in key figure properities should be option to choose how many decimal spaces you want to be visible on report (this option you have in rsa1 -> infoobjects -> your key figure -> BEx reporting tab)
    Regards,
    Andrzej

  • Trimming comma from string

    Hi all,
    I have a requirement of storing a string (containing commas) into an integer database field (without commas).
    Source Datatype: String
    Source Data example1: 2,000,765
    Source Data Example2: 1,000
    Destination Database column datatype: Number
    Destination Data should look like: 2000765 (for example1) and 1000 (for example2)
    I need to remove the commas from the incoming string and need to store it in Database column. Above I have mentioned just an example.
    I am using Jdeveloper 10.1.3.3 version.
    Please help me out in this.
    Thanks,
    Abhishek.

    Hi all,
    I have resolved this issue by using Translate function and then converting it to number in Transformation.
    Thanks,
    Abhishek...

  • REPLACE statement removing commas from a money convert... I do NOT want it to do this

    I am using a case statement to remove the '-' from a negative number and place a '(' there instead. 
    The negative side of the CASE statement is as follows:
    REPLACE(CONVERT(varchar, CONVERT(money, SUM(Begin_Balance)), 1), '-', '(') + ')'
    The positive side is:
    CONVERT(varchar, CONVERT(money, SUM(Begin_Balance)), 1)
    The data output for the positive portion is 100% correct. Here is an example of the output I receive.
    (18271.15)
    (25000.00)
    82,490.00
    45,000.00
    Why is the replace statement stripping my commas?

    >> I am using a case statement to remove the '-' from a negative number and place a '(' there instead. <<
    So many horrible fundamental errors in one sentence! 
    1.  CASE is an expression, not a statement. An expression returns a scalar value of a known data type, A statement changes the schema. 
    2. In SQL, all display formatting is done in a presentation layer, never in the database.
    3. We use the ANSI/ISO Standard  CAST()  and not the old Sybase/Unix CONVERT today
    4. We use DECIMAL() and not the old Sybase/Unix MONEY. This thing does not work; it fail to do correct math; Google it! Do a data audit and see if you can go to jail for this. 
    5. SQL is not COBOL. The COBOL language treats all data as strings. STOP DOING THAT IN SQL! This language uses abstraction in the database and the presentation does the job that your old PICTURE clause used to do. 
    Can you get a 2-3 week intro course to SQL and modern programming form your company? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Removing commas from on address line!!

    I need to remove comma's from an address field:
    substr(s_claim_periods.latest_prop_addr(CLAIMS.cla_refno),1,255) AS D,
    i have tried my usual method of
    translate (CONTACT_ADDRESS, ',' ,' ')
    but im having problems incorporating it with the substr command!!

    you could also use replace
    replace (adr, ',')as in
    SQL> with test as
      2  (select 'address,address,address,address,address' adr from dual
      3  )
      4  -- End of Testdata; here is the actual query:
      5  select adr
      6       , replace (adr, ',')
      7    from test
      8  /
    ADR                                     REPLACE(ADR,',')
    address,address,address,address,address addressaddressaddressaddressaddress

  • Removing unwanted from string

    I am trying to remove unwanted from a string. For example:
    String is "boy the movie part 2 (2009)". from this string i wanted to remove "(2009)" only, so my string can be looked like as "boy the movie part 2".
    Please provide me logic to do this.
    Thanks,
    Amol

    gimbal2 wrote:
    Hey if that's all you need:
    [snip]
    Just substring minus the last six characters and to not have to make any assumptions about whitespace being present in the result, a trim() is added for the fun of it.
    This is absolutely not fail proof, but it does what you ask.@OP: Most likely this is not what you really want. However, as gimbal2 points out, it does what you ask. The lesson is, you need to be clear and precise in expressing your requirements. To drive the point home, here is some more code that does what you asked for, but probably not what you really want it do do.
    if (str.equals("boy the movie part 2 (2009)") {
      str = "boy the movie part 2";
    }

  • Best way to remove apostrophe from string when loadiing

    Hi using an insert statement to load data some apostrophe's in string .
    We need to ensure all aposrophe's removed from such strings on loading/.
    What is best way to achive ethis.
    Uisng 11.2.0.3
    Thanks

    Use replace fucntion
    Please post ur DDL and DML for the table
    For examples you can see this
    how do i replace  single quotes in a string with say  ''  or null
    select replace('ab''''''''cd','''',' ') from dual;
    CREATE TABLE my_table
         istrng  varchar2(33)
    insert into my_table
    select replace('ab''''''''cd','''',' ') from dual;Please mark your questions as answered
          user5716448     
    Handle:      user5716448 
    Status Level:      Newbie
    Registered:      Mar 16, 2010
    Total Posts:      343
    Total Questions:      131 (80 unresolved)Edited by: Rahul India on Jan 29, 2013 6:04 PM

  • Remove .00 from string while conversion

    How do i remove .00, .01 from the string while converting that string to int
    i tried to do this
    Select REPLACE(CONVERT(varchar(15), [Cases], 1), '.00', '') from table
    UPDATE table
    SET [CASES_d] = CAST(REPLACE(CONVERT(varchar(15), [Cases], 1), '.00', '') AS INT)
    I get the error
    Conversion failed when converting the varchar value '1.10' to data type int.
    can somebody help
    Thanks

    Sorry, in that code I missed intermediate conversion into decimal(10,2). I forgot we can not convert directly.
    So, try:
    update table set cases_id = case when cases like '%[^0-9.]%' then 0 else cast(cast(Cases as decimal(10,2)) as int) end
    where cases not like '%[^0-9.]%' -- exclude updating bad rows
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • How to remove commas from xvbap-kwmeng field

    Hi All,
    Can you guys/gals help me ??
    I am having a issue with comma in xvbap-kwmeng field, I have value 1,662.000,
    How can I get rid of comma.
    and also please be aware that, I may have 1,662,123.000 situtation as well.
    How can I remove all comma's from by xvbap-kemeng field.
    Thanks
    Anitha.

    Hi,
    Check whether TRANSLATE statement works for you
    TRANSLATE xvbap-kwmeng USING ', '.
    In single quote use comma followed by a space after that use  CONDENSE  xvbap-kwmeng NO-GAPS.
    Regards,
    Selva

  • Removing Comma (,) from Year Formatting

    Hello,
    I'm attempting to generate a text string that corresponds to a given year. However, when I convert to text from the number format, the result includes a comma:
    the date's year = Text(ExtractYear(today's date)) -> "2,011"
    1. Does anyone know how to prevent the comma in the text attribute, so that I'll get "2011" rather than "2,011"?
    2. Similarly, I'd also like to know how to format the decision report so that the number variable (the output of 'ExtractYear') also does not appear with a comma.
    Thanks in advance,
    - Patrick

    This has been raised internally as OPAD-4226, so we are looking at it for a future release.
    This is a formatting issue - ie. all numbers are formatted as if they are actual numbers, but of course years have their own convention. A custom format (eg. in Web Determinations) could format without the comma but it would apply to all numeric attributes. Custom code could also be used to apply the non-comma format only to certain attributes you specify, but it's not an out-of-the-box option.

  • Removing characters from string after a certain point

    Im very new to java programming, so if this is a realy stupid question, please forgive me
    I want to remove all the characters in my string that are after a certain character, such as a backslash. eg: if i have string called "myString" and it contains this:
    109072\We Are The Champions\GEMINI
    205305\We Are The Champions\Queen
    4416\We Are The Champions\A Knight's Tale
    a00022723\We Are The Champions\GREEN DAYi would like to remove all the characters after the first slash (109072*\*We...) leaving the string as "109072"
    the main problem is that the number of characters before and after is not the always the same, and there is often letters in the string i want, so it cant be separated by removing all letters and leaving the numbers
    Is there any way that this can be done?
    Thanks in advance for all help.

    You must learn to use the Javadoc for the standard classes. You can download it or reference it on line. For example [http://java.sun.com/javase/6/docs/api/java/lang/String.html|http://java.sun.com/javase/6/docs/api/java/lang/String.html].

  • How to Remove Text From Strings ?

    Hi,
    The question I have is, in the String that I have Pasted below, how can I remove the first line (>gi|23821530|dbj||SEG_D10989S Bos taurus gene for endothelin receptor) and then use the remainder of the text to Post to a web server?
    I have tried doing this with a Regex (Pattern P = Pattern.compile("(^>.*)");), I'm able to capture the first line of text, but am not sure how to remove it and then use the rest of the text to Post to the web server.
    Any Help with this would be much appreciated
    gi|23821530|dbj||SEG_D10989S Bos taurus gene for endothelin receptorGGGATCCCGAGCAAACTGCGGAGGCCACACTGTCAGGCATTCCCTCGGCGTTTCGTCAGAGCCAGACCCT
    CCCGCTGCTGAAGGGAGGCGCGCTCTGCTCCCGGGCTGCCGGGAACCCAGCCGCGCGCCGGGGAAGGAGG
    TCCCTGCCTGGTGCGTCCGGACCAAGAGGTAACCGTTCTGCTTGGTGTTTAATTCAAATCTGTGATTGAA
    CCTTATCCTGGGGCTTCAGTTTGGATTACTTCTTAGGTTTGTTTTTGTTTGTTTGTTTGTTTTTTAACCT
    GTAGCTACAGCAGATTAAAATGGGATTGGAGTGAAGGAGAGGGCTTGAGTGTCTGAAGTCACTCGAAGGG
    GATAGAAACTTCCGAGTTAATCCAGATAGAGACTCTTCCAAATAGACCAAGTGGAGATGTCCGGGAGATT
    TTCCGAGTCAGCCGGCTCAGTCCTGGGGTGTGTGTATGGGGGGTGGGGGCGGTGCCGAAGAGCGGAAGGA
    AGGGGTCTGAAAGTCCAGACATGCGGCATCCGGGGTTGCTGTGGAGTCGAAAGCAGAGACTGGCGATGCC
    CTTGATCTCTAACCTGCCTTGATTTGCCCCGTCCCCGCGCGCCCTTGGCCAGAACGAATACTGCTCCCTC
    TGCGCACACCAGGAGCTCAAAGCTTTGCTTTGGACACCCGTCCTCTCCTCCCCGTCACACCCCTTCCAGG

    String foo = "gi|23821530|dbj||SEG_D10989S Bos taurus
    gene for endothelin receptor";
    String totalString = "gi|23821530|dbj||SEG_D10989S Bos
    taurus gene for endothelin receptor
    GGGATCCCGAGCAAACTGCGGAGGCCACACTGTCAGGCATTCCCTCGGCGTTTCG
    CAGAGCCAGACCCT
    CCCGCTGCTGAAGGGAGGCGCGCTCTGCTCCCGGGCTGCCGGGAACCCAGCCGCG
    GCCGGGGAAGGAGG
    TCCCTGCCTGGTGCGTCCGGACCAAGAGGTAACCGTTCTGCTTGGTGTTTAATTC
    AATCTGTGATTGAA
    CCTTATCCTGGGGCTTCAGTTTGGATTACTTCTTAGGTTTGTTTTTGTTTGTTTG
    TTGTTTTTTAACCT
    GTAGCTACAGCAGATTAAAATGGGATTGGAGTGAAGGAGAGGGCTTGAGTGTCTG
    AGTCACTCGAAGGG
    GATAGAAACTTCCGAGTTAATCCAGATAGAGACTCTTCCAAATAGACCAAGTGGA
    ATGTCCGGGAGATT
    TTCCGAGTCAGCCGGCTCAGTCCTGGGGTGTGTGTATGGGGGGTGGGGGCGGTGC
    GAAGAGCGGAAGGA
    AGGGGTCTGAAAGTCCAGACATGCGGCATCCGGGGTTGCTGTGGAGTCGAAAGCA
    AGACTGGCGATGCC
    CTTGATCTCTAACCTGCCTTGATTTGCCCCGTCCCCGCGCGCCCTTGGCCAGAAC
    AATACTGCTCCCTC
    TGCGCACACCAGGAGCTCAAAGCTTTGCTTTGGACACCCGTCCTCTCCTCCCCGT
    ACACCCCTTCCAGG";
    int position = -1;
    int lenght = -1;
    position = totalString.indexOf(foo) + foo.length();
    String processedString =
    totalString.substring(position);
    Thanks for the post,
    Did the job perfectly!
    cheers again

  • Removing commas from numbers

    his has a couple of items in it....
    In Numbers, I formatted a phone number column imported from a Text file, but it put in commas, like the phone is a number: 4157933161 is 4,157,933,161. Can I get rid of those commas?
    Also, I couldn't import a .txt file (a mailing list from Experian) into Numbers. When I did open the file with Numbers, Numbers put it all in 1 cell - yikes. So I had to go back to my old pc, import the .txt file (easily...) and then take that .xls file and load it on my MAC in Numbers - good golly you have got to be kidding. What am I missing. How do I import a .txt file (it actually is comma seperated but marked as an .txt file - MS Excel had no problem)
    This has to do with printing Pages or say pages from the Web. Can you print just a selection of say a Pages doc. Say I select /highlight one paragraph of a 50 page document and want to just print that, on MS in the Print page there is a box "selection" which commands the printer to only print what you selected/highlighted. Customer Care at Apple said he did not know of anyway to do this...yikes again.

    In Numbers, I formatted a phone number column imported from a Text file, but it put in commas, like the phone is a number: 4157933161 is 4,157,933,161. Can I get rid of those commas?
    Find / Replace is your friend.
    Find "," Replace by nothing.
    Also, I couldn't import a .txt file (a mailing list from Experian) into Numbers. When I did open the file with Numbers, Numbers put it all in 1 cell - yikes. So I had to go back to my old pc, import the .txt file (easily...) and then take that .xls file and load it on my MAC in Numbers - good golly you have got to be kidding. What am I missing. How do I import a .txt file (it actually is comma seperated but marked as an .txt file - MS Excel had no problem)
    Comma Separated Values files are correctly treated if their name extension is .csv.
    This has to do with printing Pages or say pages from the Web. Can you print just a selection of say a Pages doc. Say I select /highlight one paragraph of a 50 page document and want to just print that, on MS in the Print page there is a box "selection" which commands the printer to only print what you selected/highlighted. Customer Care at Apple said he did not know of anyway to do this...yikes again.
    He is perfectly right. There is no such feature.
    As we may print a given range of pages it's not a true problem.
    We may insert temporary page breaks to do the trick.
    And of course, if you prefer MS you may stay with it !
    Yvan KOENIG (from FRANCE mercredi 22 octobre 2008 11:20:29)

Maybe you are looking for

  • Wrong covers downloading to iTunes

    When copying my discs to iTunes, most artwork downloads automatically and attaches to the albums, but some artwork simply doesn't appear. In such cases, I scan the original covers and drag the images into iTunes. Fine, most of the time, but on a few

  • Cdrecord/brasero burn the ISO file as data file instead of as image

    Following the wiki, I was able to burn a Cd witht he command: $ sudo cdrecord -v driveropts=burnfree dev=/dev/cdrom -dao "isofile.iso" Things seemed to go fine and I got this output: TOC Type: 1 = CD-ROM scsidev: '/dev/sr0' devname: '/dev/sr0' scsibu

  • Import Standard Business Area of Oracle Applications

    Dear all, I install Discoverer Administration 4i and i create EUL (Apps) to connect to Oracle Applications 11.5.0, when I import Standard(BASE) Business Area of Applications ,some BA are imported but not all. Can anyone help me to import all BA ? Tha

  • Convert previously converted raw files with Adobe DNG converter?

    It seems that i am not able to convert my raw files that have already been previously converted to dng with the dng converter.  I am wanting to start editing all over again with the raw image but before i can start editing a raw image, i have to conv

  • Edit with Fireworks

    There is no "edit in fireworks" command on this context menu even though I have Fireworks installed. I only have "edit with . . ." and it makes me choose the external program .exe file every time I need to edit an image. How can I define an editor? I