Extract numbers from text

Hi guys,
I have a column that contains Names with Mobile numbers. How can I get rid off the letters in the column, or how can I extract only the numbers from the column!!!!
Best Regards,

Or you can use REAPLCE and TRANSLATE functions if your DB versio is lower than 10g
SELECT REPLACE(TRANSLATE(UPPER('ArunKumarGupta9000888777'),'ABCDEFGHIJKLMNOPQRSTUVWXYZ',' '),' ','')
  FROM DUALRegards
Arun

Similar Messages

  • API extracting keywods from text files

    hi all,
    i will be grateful if any of you can suggest some free java api which can be used to extract keywords from text files.
    thanx in advance
    malls

    java.util.regex - regular expressions API in JDK 1.4

  • Extract numbers from mixed string.

    How do I extract numbers from a mixed-character string?
    These are house numbers and I have some exceptions - examples below.
    How do I get rid of the letter/dash part, and keep the numeric part only?
    38A
    5600B
    23-A
    Thanks a lot.
    -John

    It does not work if you have a string like 3343S##@1~!234
    OP, you can try this:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> with t as(
      2      select '38A' c1 from dual union all
      3      select '5600B' from dual union all
      4      select '5Bas@#$%1SDf3ff`~7' from dual union all
      5      select '3343S##@1~!234' from dual union all
      6      select '23-A+9' from dual )
      7  --
      8  select c1,regexp_replace(c1,'[^[:digit:]]') only_num  from t;
    C1                 ONLY_NUM
    38A                38
    5600B              5600
    5Bas@#$%1SDf3ff`~7 5137
    3343S##@1~!234     33431234
    23-A+9             239
    SQL>

  • Extract addresses from text

    I'm trying to use automator to extract addresses from a text document. It's a long list of addresses and I eventually need to print them on to mailing labels. The trouble is having them identified, and extracted. After that I can put them into address book and take care of the printing. Any suggestions on where to start in automator?

    Plain text, entries are separated by a blank line.
    The format is typically:
    City, State
    Company
    address line 1
    address line 2
    City, State Zip
    Phone: ###-###-####
    Fax: ###-###-####
    E-Mail: [email protected]
    Web: http://www.website.com
    We're only looking to use the first 5 lines. I would like to pipe this information into address book. Then print labels from there, but that can be handled outside of automator. It's pulling the data out of the text that I'm having trouble with.
    It's a a lot to do by hand. Work smarter not harder right?

  • Extract photos from text messages

    Greetings,
    Is there an easy way or an app that can extract all the photo's and video that I have received in text messages on my iphone.  I recently checked and I have 1.8 Gig usage in Messages.  I could go through one message at a time but that could take a while!
    Thanks,
    Brian

    Save Files
    SMS
    1. Go to Text Messages view, threader veiw that shows the pic preview when its not opened.
    2. Press and hold on Pic
    3. Select Save from the list\
    4. Now the pic should be saved in SD/Messages folder
    EMAIL
    1. Open Email
    2. At top there should be the number and the words "View Attachments" - Click on View Attachments
    3. Now you should have a list of attachments with a arrow next to it if not downloaded.
    4. Click file you want to download and you should get a animation where the arrow was that is indicating its being downloaded.
    5. Once the animation stops this means file has been downloaded to a temp file to be viewed.
    6. Now Press and Hold on file text and a window should open with three options - VIEW - SAVE- and SHARE
    7. Select Save from list
    8. Once complete it will have a little message at bottom of page that says "File was downloaded to SD Card"
    9. Now file will be saved in SD / Messages folder on SD Card.
    To Save As Wallpaper:
    1. Open Gallery
    2. Click on photo
    3. Click Left Menu button
    4. Select "More"
    5. Select "Set As"
    6. Wallpaper
    7. Click Save after you resize image to preferred size

  • Extract DATE from TEXT column

    Dear all,
    I have the following comment in column in one my table. Is there a smart way to extract the
    DATE from the text, It may be in any date format.
    'My comments (written submissions sent on 29-SEP-2006)'
    'My comments are 24 September 2009 9.30 '
    'My comments, 15.12.2008'
    'My comments on 25.11.2008'
    'form 2008/ My comments 11 JUN 2007'
    'my comment on 4-4-2008'
    'My comm. -extens.not possible - 23.03.2007 09:00'
    'MyComm.on 04/04/06'
    'My comments on 15 Sep 2009 at 9.15h at EPO, changed on 16 sep 09' -- in this case 15 Sep 2009 is needed
    Please share your views.
    Regards,
    Vikash Kumar

    Hi,Try with this one
    SELECT REGEXP_SUBSTR('My comments (written submissions sent on 29-SEP-2006','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments are 24 September 2009 9.30 ','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments, 15.12.2008','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments on 25.11.2008','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('form 2008/ My comments 11 JUN 2007','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('my comment on 4-4-2008','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comm. -extens.not possible - 23.03.2007 09:00','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('MyComm.on 04/04/06','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments (written submissions sent on 29SEP2006','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments (written submissions sent on 29SEP.2006','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments (written submissions sent on 29022006','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual

  • How to extract data from  text file to database table

    Hi ,
    I am trying to upload  data in text file to database table  using GUI_UPLOAD function .what would be the program for that.
    thanks in advance.

    Hi,
    I don't think you have a standard sap program to upload data from file to database table...
    Instead you can create a custom program like this..
    DATA: T_FILEDATA(1000) OCCURS 0 WITH HEADER LINE.
    DATA: T_ZTABLE LIKE ZTABLE OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = 'C:\TEST.TXT'
      tables
        data_tab                      = T_FILEDATA
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT T_FILEDATA.
      T_ZTABLE = T_FILEDATA.
      APPEND T_ZTABLE.
    ENDLOOP.
    MODIFY ZTABLE FROM TABLE T_ZTABLE.
    COMMIT WORK..
    Thanks,
    Naren

  • Extract values from text in reporting environment

    I need write a query based on a bunch of user supplied IDs. The IDs will be pasted as plain text, one per row, by end user in a memo field in the reporting environment, and I need to do something like this:
    SELECT PHONE_NUMBER FROM TELEPHONE
    WHERE
    ID IN('MEMO_ID1', 'MEMO_ID2',.....)
    Reporting environment does not provide any tools to automatically convert plain text into IDs.
    Is there any way in SQL I can do this?

    In this case you may going for the "words" with something like
    with memos as (
      select 'id1'||chr(10)||'id2'||chr(10)||'id3'||chr(10)||'id4' id from dual
    , telephone as (
      select 'id2' id, '46574' PHONE_NUMBER from dual
    select
      PHONE_NUMBER
    from telephone
    where
    id in (
      select regexp_substr(id, '\w+',1,level) id
      from memos
      connect by
      level <= regexp_count(id,'\w+',1)
    PHONE_NUMBER
    46574But take a look at the docs, http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/adfns_regexp.htm#CHDJGBGG,
    to be sure that \w covers all alpahnumeric characters could be in the id, more important be aware, that all characters not belonging to the character class \w, are treated as separators, as # for example.
    So another way could be going for the separators. Notice that chr(13) is replaced by chr(10) before, in order to cover the mosts common linebreaks.
    with memos as (
      select 'id1'||chr(10)||'id_#2'||chr(13)||chr(10)||'id3'||chr(10)||'id4' id from dual
    , r_memos as (
      select replace (id, chr(13), chr(10)) id from memos
    select regexp_substr(id, '[^'||chr(10)||']+' ,1,level) id
      from r_memos
    connect by level <= regexp_count(id,'['||chr(10)||']+') + 1
    ID
    id1
    id_#2
    id3
    id4regards

  • Extract date from text string - Transact-SQL

    Hello,
    I have a field in my database with an archived date... (Giampaoli  Live Oak, Almonds Archive 09/16/10)
    I need to be able to extract the date from this, then perform a datepart function on it... How do I extract the date into it's own value using just SQL?
    Thanks,
    Wes

    Thanks Guys,
    This helped me:
    select
    ID,
    NAME,
    datepart(month, CONVERT(date, SUBSTRING(YOUR_COLUMN_NAME, patindex('%[0-9][0-9]/[0-9][0-9]/[0-9][0-9]%', YOUR_COLUMN_NAME), 50))) AS MONTHARCHIVED,
    datepart(YEAR, CONVERT(date, SUBSTRING(YOUR_COLUMN_NAME, patindex('%[0-9][0-9]/[0-9][0-9]/[0-9][0-9]%', YOUR_COLUMN_NAME), 50))) AS YEAR_ARCHIVED
    FROM
    TABLEABC
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • Extracting paragraphs from text

    Hi,
    I am reading text ( consisting of many paragraphs ( sample given below) into a variable
    As you can see this text contains 3 paragraphs.
    Can you let me know how to each paragraph.
    Best Regards,
    R. Ramachandran
         A contrary view has been taken in England on the corresponding
    provisions of the English Companies Acts of 1862
    +     It is true that under section 76 of the Act a general meeting of a+
    company has to be held once at least in every calendar year and if a
    default is made, the company and every director or the manager of the
    company who is knowingly and wilfully a party to the default shall be
    liable to a fine not exceeding five hundred rupees.
    +     Nor do we think that sub-section (5) of section 32 by imposing a+
    daily fine during the continuance of the default indicates the following.

    user4494500 wrote:
    ..This chunk of text is stored in Visual foxpro database. Where the data originates from is not relevant.
    In my Java program, I'm reading this chunk of text into a variable.Equally irrelevant.
    I want to use some method to analyse this variable and split out the paragraphs.I specified the process in my first post. If you cannot progress from there, or post an SSCCE that demonstrates where you are stuck, I guess you are stuffed.

  • Extracting number from text files for variable

    Hello again,
    I have several different types of text files all with the line
    # NPTS=32768  DT=0.005
    somewhere in the file.  The numerical values are different for each file and I need to pull them out to assign as a variable for a program I am running.
    How can I search a file and pull out each of these two numbers?
    Thank you

    Procyon's sed script assumes that the NPTS number and the DT number will both always have a period in them. In the original, the NPTS number doesn't have a period, and I don't know whether the DT number may lack a period.
    You could try this instead (replacing the 's~....~p' part of Procyon's script):
    's~# NPTS=\([0-9.]*\) *DT=\([0-9.]*\)~\1,\2~p'
    That may let in stuff you want to exclude, for instance, it would let in:
    NPTS=0.0.0.0.0 DT=1.1.1.1.1
    and:
    NPTS=....... DT=
    and so on. But it's a tradeoff: if you know your data doesn't include anything like that, you can go with a simpler sed script. If you need to be fussier about what you're matching, then your sed script will need to be more complex.
    EDIT: What I said in first paragraph is wrong. I overlooked the '*' after the '\.' in Procyon's script. What he's got will permit but not require a period. My final point still applies, though, to both of our suggestions. His script and my script would both match the second of my bad cases.
    Last edited by Profjim (2008-09-17 21:31:34)

  • How to extract code from text box in html format

    "I have a text box. When the form is submitted I need to extract the data in html format. i.e. a string type variable needds to hold all html tags alongwith[b] the data."

    A textbox submitted in a form delivers a String. What's inside is no issue. If you want to process it further, pick the tool of your choice, like an HTML parser.

  • Can't extract ringtone from text message

    My son sent me a ring tone via text message. The last time he did this I was able to touch the ring tone on my screen and save it to my phone. This time it won't let me. The only difference I can see if that this ring tone was made using Quicktime. Is there something I should be doing to save it to my phone? My computer was hit with a virus so I can't even send it to my email and drag it over.
    Any help would be appreciated.

    When I got the iPhone in June I set it up on my laptop. The ringtones were sent to me by my sons. I thought I had put them on my phone my saving them directly on my iPhone from a text, but everyone is telling me I didn't. So I am assuming I synched them over. In July my laptop was hit by some virus. The laptop had to by wiped clean. I got my laptop back last week. I had to download a new iTunes to my the computer. I did that. I transferred my music purchases over, my app purchases and I synched my phone, but the existing ringtones on my phone did not synch over. When I went to click the synch button I got that bizarre message. Fearfull I would loose those ringtones I did not sync. I have a ringtone that my son emailed me in the library of my iTunes, but I can't get it to my phone because if I sync it I am afraid I will loose it.

  • I want to read lines from file, count it and extract numbers from a first line.

    i must do un loop?

    HI,
    i try to explain how to use to LABVIEW TOOLS...
    1. USE a for next loop
    2. here you must open the file with the VI. read lines from file.
    you can choos how many lines you read at same time.
    3. the string you can convert into an number.
    4. in the loop is the literal counter... this is you line couter....
    iun schrieb:
    > i must do un loop?

  • When I add contacts from text messages they don't show up in my Contacts list.

    Right, I hope I didn't miss another thread. Nothing appears in my contacts list when I try to save numbers from text messages. The only way to save a contact is to type it manually. But the "save to contacts" option is there, so where is it actually saving all those numbers ?

    Hey Xyz321Abc,
    Thanks for the question. Let’s check to make sure all of your groups are being displayed. It is possible that your new contacts are defaulting to a group that is hidden. With the Contacts application open, do the following to make sure that all groups are checked:
    Show or hide a group. Tap Groups, then select the groups you want to see. This button appears only if you have more than one source of contacts.
    Add contacts - iPhone
    http://help.apple.com/iphone/7/#/iph14a87326
    Thanks,
    Matt M.

Maybe you are looking for