473,546 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remove unwanted charcters from phone numbers

Hi
I need to remove unwanted characters from phone numbers from my phone bill
to analyse the data.
Some examples are
02 48222222 i need to remove the space
+61266667656 i need to remove the +
0427 221 529 i need to remove both spaces
0419 637 344MNET i need to remove the spaces and the MNET
telstra.wap i need to remove all of this
+61408400510MNE i need to remove the + and MNE

I think Telstra my phone company has done this on purpose to stop people
like myself from analysing their phone calls

I have tried using right, left and length functions in a query but this does
not seem to work properly and is cumbersome

Any help would be greatly appreciated

Thanks Danny
Jun 5 '06 #1
3 7841
Danny Yeadon wrote in message <44********@dne ws.tpgi.com.au> :
Hi
I need to remove unwanted characters from phone numbers from my phone
bill to analyse the data.
Some examples are
02 48222222 i need to remove the space
+61266667656 i need to remove the +
0427 221 529 i need to remove both spaces
0419 637 344MNET i need to remove the spaces and the MNET
telstra.wap i need to remove all of this
+61408400510MNE i need to remove the + and MNE

I think Telstra my phone company has done this on purpose to stop
people like myself from analysing their phone calls

I have tried using right, left and length functions in a query but
this does not seem to work properly and is cumbersome

Any help would be greatly appreciated

Thanks Danny


I think this calls for a user defined function, where I'd probably loop
the string, verify each character and append the numbers to the result
string - perhaps something like the air code below (try it in a
standard module, not a form/report class module)

public function stripunvanted(b yval v_strIn) as string
dim lngCount as long
if not isnull(v_strIn) then
for lngCount = 1 to len(v_strIn)
if isnumeric(mid$( v_strIn, lngCount, 1)) then
strOut = strOut & mid$(v_strIn, lngCount, 1)
end if
next lngCount
end if
stripunvanted = strOut
end function

call it with stripunvanted([name of your field]) in the query.

--
Roy-Vidar
Jun 5 '06 #2
dim s as string

s = replace(Formatt edPhoneNumber, "+", "")
s = replace(s, " ", "")
FormattedPhoneN umber would be replaced by whatever your field name is that
holds the formatted phone number.

Be sure to notice that after the first Replace you reference s, not the
original field.
Jun 5 '06 #3
Thanks Roy
It worked Beautifully

Danny

"RoyVidar" <ro************ *@yahoo.no> wrote in message
news:mn******** *************** @yahoo.no...
Danny Yeadon wrote in message <44********@dne ws.tpgi.com.au> :
Hi
I need to remove unwanted characters from phone numbers from my phone
bill to analyse the data.
Some examples are
02 48222222 i need to remove the space
+61266667656 i need to remove the +
0427 221 529 i need to remove both spaces
0419 637 344MNET i need to remove the spaces and the MNET
telstra.wap i need to remove all of this
+61408400510MNE i need to remove the + and MNE

I think Telstra my phone company has done this on purpose to stop people
like myself from analysing their phone calls

I have tried using right, left and length functions in a query but this
does not seem to work properly and is cumbersome

Any help would be greatly appreciated

Thanks Danny


I think this calls for a user defined function, where I'd probably loop
the string, verify each character and append the numbers to the result
string - perhaps something like the air code below (try it in a
standard module, not a form/report class module)

public function stripunvanted(b yval v_strIn) as string
dim lngCount as long
if not isnull(v_strIn) then
for lngCount = 1 to len(v_strIn)
if isnumeric(mid$( v_strIn, lngCount, 1)) then
strOut = strOut & mid$(v_strIn, lngCount, 1)
end if
next lngCount
end if
stripunvanted = strOut
end function

call it with stripunvanted([name of your field]) in the query.

--
Roy-Vidar

Jun 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1840
by: Chris Kettenbach | last post by:
Good Morning, I have a text box on a webform I use to display a phone number. The database field does not contain parentheses or hyphens. I want the use to be able to change the textbox text and be able to click an update button to save the changes to the database? My question is how do I remove the unwanted characters and save that value...
4
4532
by: Brian Henry | last post by:
I have phone numbers like this in a data table 123-435-1234 1231231234 432.234.2321 they all have different formatting, what I want to do is get them all formatted like this (123) 123-1234
4
5247
by: Earl | last post by:
I'm curious if there are others who have a better method of accepting/parsing phone numbers. I've used a couple of different techniques that are functional but I can't really say that I'm totally happy with either. 1. My first technique was to restrict the users to entries that could only be 3 character, 3 characters, 4 character (area...
10
14285
by: JackM | last post by:
I'm still working on validating the phone numbers that are entered on a form but have come across a problem I don't understand how to fix. I can handle most instances when it's in regular US formats (555-555-5555 or (555) 555-5555 or 555 555 5555) but I'm having trouble when the entry is ten consecutive numbers with nothing else (5555555555)....
29
3151
by: Marco | last post by:
Hello, I have : float f = 36.09999999; When I do : char cf; sprintf(cf,"%0.03lf", f); I get : 36.100
5
16836
by: joe | last post by:
hello i have a databse program that uses char arrays to output data to reports. I would like to remove all invalid characters from the array and replace them with a blank space. I have problems with ( ' return and some non ascii charcters. Any quick and dirty way to do this? thanks.
5
3283
by: lim4801 | last post by:
I am currently in doing a program which is given by my tutor: Contemplate that you are working for the phone company and want to sell "special" phone numbers to companies. These phone numbers are "special" because they are easily translated into words. You've been asked to create a list of phone numbers that are directly mappable to words by...
4
2509
by: Blue Streak | last post by:
Hello, Folks! Does anyone know of a website that lists the local phone number formats for each country? TIA...
7
3858
by: Propoflady | last post by:
My contacts can have as many as five or six phone numbers - is it possible to make a query that puts the name, and each phone number after it on the same line - for this reason I have two tables - client and phone linked by client id right now I get contact a - phone number 1 contact a - phone number 2 I would like
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7461
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.