Remove characters from phonenumbers
Hello,
I have the following problem:
35% of the phonenumbers in my contacts contain a wrong phone number format.
Some phonenumbers in my contacts contain a format like +<country code> (0)<area code> phonenumber or (+<country code> <area code>)<phonenumber> or (<areacode>)<phone number>
Because the numbers are formated with ( ) and - i have problems with my bluetooth device when dailing from my addresbook/contacts
I want to remove the (0) from all the phone numbers and all other illegal charactars so the format will be like this:
+<country code> <areacode> <phonenumber>
I tried the Mac App Contacts Cleaner but this app does not reconize the current format and can not translate to my required format.
So i have to edit 200 contacts by hand.
Please advice.
Thanks
Try this:
$iscsitarget = Get-EqlVolume -VolumeName TZ | select -ExpandProperty iSCSITargetName
Similar Messages
-
Removing characters from an input data-field
Hi.
Is it possible to "Trim Off" characters from a Text Field data, and automatically input them into another Text field?
Let's say I have the following code :
*<Field name='telephonenumber'>*
*<Display class='Text'>*
*<Property name='title' value='Phone Number in International Format'/>*
*<Display>*
*</Field>*
This code is to input the telephone number in International Format (such as : +1 234 567 8900)
Now, lets say that I want to create a second Data Text field for phone number; but, this time, it is for the phone number in LOCAL format.
In other words, I want to write a code which will AUTOMATICALLY remove the first 3 or 4 characters from the "International Number", and input them into the "Local Number" field.
This would save me the trouble or writing the number a second time. My code should be able to simply Trim Off the initial "+1 234", and automatically input the remaining "*567 8900"* into the Local Number field.
How could I accomplish this?
ThanksBased on your code, it looks like you have fields called global.workgsmad (local style) and global.workgsm (international style)
Assuming your global.workgsm format will always be '+x xxx xxx xxxx' you want to skip the first 6 characters, not 4
The simplest way to do this is like so:
<Field name='global.workgsmad'>
<Expansion>
<substr>
<ref>global.workgsm</ref>
<i>6</i> <!-- Skip the country code and area code '+x xxx ' -->
<i>8</i> <!-- 8 characters were left for the format 'xxx xxxx' -->
</substr>
</Expansion>
</Field>Alternatively, you could change the substr block to read
<substr s='6' l='8'>
<ref>global.workgsm</ref>
</substr>Both formats are valid.
If the phone number is not a fixed format, you'll have to do something more complicated.
Jason -
Remove $%&* characters from a String
Hi,
I have the following program that is supposed to detect a subsequence from a String (that contains $ signs) and remove it. This is a bit tricky, since because of $ signs, the replaceAll method for String does not work. When I use replaceAll for removing the part of the String w/ no $ signs, replaceAll works perfectly, but my code needs to cover the $ signs as well.
So far, except for replaceAll, I have tried the following, with the intent to first remove $ signs from only that specific sequence in the String (in this case from $d $e $f) and then remove the remaining, which is d e f.
If anyone has any idea on this, I would greatly appreciate it!
Looking forward to your help!
public class StringDivider {
public static void main(String [] args)
String symbols = "$a $b $c $d $e $f $g $h $i $j $k l m n o p";
String removeSymbols = "$d $e $f";
int startIndex = symbols.indexOf(removeSymbols);
int endIndex = startIndex + removeSymbols.length()-1;
for(int i=startIndex;i<endIndex+1;i++)
if(symbols.charAt(i)=='$')
//not sure what to do here, I tried using replace(oldChar, newChar), but I couldn't achieve my point, which is to
//delete $ signs from the specific sequence only (as opposed to all the $ signs)
System.out.println(symbols);
}A little modification on the last version:
This one's more accurate.
public class StringDivider {
public static void main(String [] args){
String symbols = "$a $b $c $d $e $f $g $h $i $j $k l m n o p";
String removeSymbols = "$d $e $f $g";
if(symbols.indexOf(removeSymbols)!=-1)
if(removeSymbols.indexOf("$")!=-1)
removeSymbols = removeSymbols.replace('$', ' ').trim();
removeSymbols = removeSymbols.replaceAll("[ ]+", " ");
String [] symbolsWithoutSpecialChars = removeSymbols.split(" ");
for(int i=0;i<symbolsWithoutSpecialChars.length;i++)
symbols = symbols.replaceAll("[\\$]*"+symbolsWithoutSpecialChars, "");
symbols = symbols.replaceAll("[ ]+", " ");
else
symbols = symbols.replaceAll(removeSymbols, "");
symbols = symbols.trim();
System.out.println(symbols); -
Removing characters from a String (concats, substrings, etc)
This has got me pretty stumped.
I'm creating a class which takes in a string and then returns the string without vowels and without even numbers. Vowels and even characters are considered "invalid." As an example:
Input: "hello 123"
Output: "hll 13"
The output is the "valid" form of the string.
Within my class, I have various methods set up, one of which determines if a particular character is "valid" or not, and it is working fine. My problem is that I can't figure out how to essentially "erase" the invalid characters from the string. I have been trying to work with substrings and the concat method, but I can't seem to get it to do what I want. I either get an OutOfBoundsException throw, or I get a cut-up string that just isn't quite right. One time I got the method to work with "hello" (it returned "hll") but when I modified the string the method stopped working again.
Here's what I have at the moment. It doesn't work properly for all strings, but it should give you an idea of where i'm going with it.
public String getValidString(){
String valid = str;
int start = 0;
for(int i=0; i<=valid.length()-1; i++){
if(isValid(valid.charAt(i))==false){
String sub1 = valid.substring(start, i);
while(isValid(valid.charAt(i))==false)
i++;
start=i;
String sub2 = valid.substring(i, valid.length()-1);
valid = sub1.concat(sub2);
return valid;
}So does anybody have any advice for me or know how I can get this to work?
Thanks a lot.Thansk for the suggestions so far, but i'm not sure how to implement some of them into my program. I probably wasn't specific enough about what all I have.
I have two classes. One is NoVowelNoEven which contains the code for handling the string. The other is simply a test class, which has my main() method, used for running the program.
Here's my class and what's involved:
public class NoVowelNoEven {
//data fields
private String str;
//constructors
NoVowelNoEven(){
str="hello";
NoVowelNoEven(String string){
str=string;
//methods
public String getOriginal(){
return str;
public String getValidString(){
String valid = str;
int start = 0;
for(int i=0; i<=valid.length()-1; i++){
if(isValid(valid.charAt(i))==false){
String sub1 = valid.substring(start, i);
while(isValid(valid.charAt(i))==false)
i++;
start=i;
String sub2 = valid.substring(i, valid.length()-1);
valid = sub1.concat(sub2);
return valid;
public static int countValidChar(String string){
int valid=string.length();
for(int i=0; i<=string.length()-1; i++){
if(isNumber(string.charAt(i))==false){
if((upperVowel(string.charAt(i))==true)||lowerVowel(string.charAt(i))){
valid--;}
else if(even(string.charAt(i))==true)
valid--;
return valid;
private static boolean even(char num){
boolean even=false;
int test=(int)num-48;
if(test%2==0)
even=true;
return even;
private static boolean isNumber(char chara){
boolean number=false;
for(int i=0; i<=9; i++){
if((int)chara-48==i){
number=true;
return number;
private static boolean isValid(char chara){
boolean valid=true;
if(isNumber(chara)==true){
if(even(chara)==true)
valid=false;
if((upperVowel(chara)==true)||(lowerVowel(chara)==true))
valid=false;
return valid;
}So in my test class i'd have something like this:
public class test {
public static void main(String[] args){
NoVowelNoEven test1 = new NoVowelNoEven();
NoVowelNoEven test2 = new NoVowelNoEven("hello 123");
System.out.println(test1.getOriginal());
//This prints hello (default constructor string is "hello")
System.out.println(test1.countValidChar(test1.getOriginal()));
//This prints 3
System.out.println(test1.getValidString());
//This SHOULD print hll
} -
Removing characters from a String
Hi!
I have a large String that has some unwanted characters in it that I want to remove. Here is an example:
AA1lbmNvZGVkUGFy\015\012YW1zdAACW0JbABBlbm5MQ2Is there any method I can use to remove the characters \015\012 from the String. I looked at the method String.replace(char, char); but this is unsuitable because I can only remove one charater at a time an I may have this character occuring legitimately elsewhere in my String. Would it be possible in some way to traverse the String and identify the pattern of \015\012 and remove that.
I'd appreciate any help,
Thanks
ChrisSpecifically, str = str.replaceAll("\\\\01[25]", "");The replaceAll method is only available in v1.4.0 or later.
-
Remove characters from rightside
In my query I select the following table
,pa_expenditure_items_all.ORIG_TRANSACTION_REFERENCE.
The output gives values like
12567245:2
12567244:2
12567247:3
9367349:2
9367349:4
I would like to remove the last two positions in this output.
However this proves to be, for me, more difficult then expected.
The total number of characters varies so i can't use SUBSTR with counting starting from the left side.
I tried REPLACE and TRIM but didn't get it right.
Hope someone can help my out on this.Several methods are available:
WITH pa_expenditure_items_all AS (SELECT '12567245:2' orig_transaction_reference
FROM dual
UNION
SELECT '9367349:23'
FROM dual
UNION
SELECT '79367349'
FROM dual
SELECT orig_transaction_reference
, SUBSTR(orig_transaction_reference
,1
,DECODE(INSTR(orig_transaction_reference, ':')
,0, LENGTH(orig_transaction_reference) + 1
,INSTR(orig_transaction_reference, ':')
) - 1
) new_val_v1
, REGEXP_SUBSTR(orig_transaction_reference
,'^[^:]+'
) new_val_v2
FROM pa_expenditure_items_all
ORIG_TRANS NEW_VAL_V1 NEW_VAL_V2
12567245:2 12567245 12567245
79367349 79367349 79367349
9367349:23 9367349 9367349C. -
What are some ways that I could remove the hyphens, semicolons, periods, and empty strings from a date (in a single expression)?
If I have a date (returned from GETDATE()) as follows:
2014-09-15 16:53:09.253
I want to remove the non-numeric characters and return this:
20140915165309253
Can REPLACE be used to identify more than one character pattern to replace?
Thank you for your help!
cdun2Another way, don't remove at all, begin with just the requisite dateparts and datenames. Although either way works fine, this way gives you absolute control over how you render.
In this example, the "from sys.messages" is not part of the answer, I just included it to recreate a test to compare speeds. It ends up having the same speed/execution plan/actual CPU time used either way.
The "Right()" functions are required, because for example, if the time is 8:03, the "03" is presented as just "3", so you have to force it to render as "03" with the Right function. The DatePart(month) is the
only one returning an integer result, so that must be cast as Varchar, the DateName() functions return a string, although unfortunately with leading zeroes removed.
Select Datename(year, SysDateTime())
+ Right('0' + Cast(DatePart(month, SysDateTime()) as varchar(2)) , 2)
+ Right('0' + DateName(day, SysDateTime()), 2)
+ Right('0' + DateName(hour, SysDateTime()), 2)
+ Right('0' + DateName(minute, SysDateTime()), 2)
+ Right('0' + DateName(second, SysDateTime()), 2)
+ Right('0' + DateName(ms, SysDateTime()), 3) , sysdatetime()
from sys.messages sm1
Select REPLACE(REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR(30), GETDATE(), 121),'-',''),':',''), '.',''),' ',''), sysdatetime()_
from sys.messages sm1 -
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].
-
I need some help on removing characters from a string. The problem I am having is due to the fact the portion of the string I need to keep varies. A few examples are:
1298-1011-1-842-10-0
1298-1011-1-842-103-0
1298-1011-1-842-1034-0
1298-1011-1-842-10345-0
I need only the fifth set of numbers (10,103,1034,10345) out of these id numbers. I guess I need a way to remove everything with a "-" from both the right and left of the fifth set of numbers. The left function works to remove the trailing two digits ("-0") off of each string. I am just having a problem figuring out how to strip out the rest when it varies. Any help would be appreciated.If you are using 10g you could use REGEXP_REPLACE. For example...
create table test1 (col1 varchar2(50));
insert into test1 values ('1298-1011-1-842-10-0');
insert into test1 values ('1298-1011-1-842-103-0');
insert into test1 values ('1298-1011-1-842-1034-0');
insert into test1 values ('1298-1011-1-842-10345-0');
create table test2 (c1 number, c2 varchar2(10));
insert into test2 values (10, 'a');
insert into test2 values (103, 'b');
insert into test2 values (1034, 'c');
insert into test2 values (10345, 'd');
SQL> select regexp_replace(col1, '.*-.*-.*-.*-(.*)-.*', '\1') col5 from test1;
COL5
10
103
1034
10345
SQL> select t1.*, t2.* from test1 t1, test2 t2
2 where regexp_replace(t1.col1, '.*-.*-.*-.*-(.*)-.*', '\1') = t2.c1;
COL1 C1 C2
1298-1011-1-842-10-0 10 a
1298-1011-1-842-103-0 103 b
1298-1011-1-842-1034-0 1034 c
1298-1011-1-842-10345-0 10345 d
SQL> JR -
Removing non-English characters from data.
Ours is global system with some data with non-English characters. We want to download file by removing this non-English characters.
Any suggestions how we can remove these non-English characters from file..?The FM u said
Replace non-standard characters with standard characters
Functionality
SCP_REPLACE_STRANGE_CHARS processes a text so that it only contains
simple characters. Special characters and national characters are
replaced in such a way that the text remains reasonably legible.
The character set 1146 is used by default. In this case the following
replacements are made, for example:
Æ ==> AE (AE)
 ==> A (Acircumflex)
Ä ==> Ae (Adieresis)
£ ==> L (sterling)
Note that the new text can be longer than the old.
So i dont think it ll be useful for eliminating the sp. chars.
U have to check each and every alphabet with std 26 alphabets
Thanks & Regards
vinsee -
Removing non english characters from my string input source
Guys,
I have problem where I need to remove all non english (Latin) characters from a string, what should be the right API to do this?
One I'm using right now is:
s.replaceAll("[^\\x00-\\x7F]", "");//s is a string having chinese characters.
I'm looking for a standard Solution for such problems, where we deal with multiple lingual characters.
TIA
NitinNitin_tiwari wrote:
I have a string which has Chinese as well as Japanese characters, and I only want to remove only Chinese characters.
What's the best way to go about it?Oh, I see!
Well, the problem here is that Strings don't have any information on the language. What you can get out of a String (provided you have the necessary data from the Unicode standard) is the script that is used.
A script can be used for multiple languages (for example English and German use mostly the same script, even if there are a few characters that are only used in German).
A language can use multiple scripts (for example Japanese uses Kanji, Hiragana and Katakana).
And if I remember correctly, then Japanese and Chinese texts share some characters on the Unicode plane (I might be wrong, 'though, since I speak/write neither of those languages).
These two facts make these kinds of detections hard to do. In some cases they are easy (separating latin-script texts from anything else) in others it may be much tougher or even impossible (Chinese/Japanese). -
Removing numerals/garbage characters from search in Section 508 build WebHelp
I need to remove (prevent inclusion of) numerals and garbage characters from search results in WebHelp when compiled with Section 508 Output enabled. I need to have Section 508 enabled. Can that be done?
Thanks for your time!Thanks, Jeff. I tried including the characteres in the Stop list and recompiling. (I even closed the project and reopened.) The characters still appear. The characters I'm trying to remove are: !, #, ', (, ), -, /, :, ;, and ,. I am also trying to exclude some numbers (100.00usd, 1999.99, 2999.99, 3999.99, 4999.99, and 6pm).
The Stop list consists of those characters and the default text. Forgot to mention is the first post ... I'm using RH9.
The Section 508 flag does create 508-compliant HTML output and that is one of the requirements for this help system. This is the first time I am enabling this flag. -
How do I remove spaces and special characters from the file name during rendering?
I understand that I can set LR_renamingTokensOn to true, but I would like to replace all spaces in the file name with an underscore and remove characters not in the range A-Z and 0-9. What's the easiest way to achieve this?
local photo = catalog:getTargetPhoto()
local sesn = LrExportSession {
photosToExport = { photo },
exportSettings = {
-- ... (determine from export preset) - whatev you want, just be sure you set export directory: LR_export_destinationPathPrefix
LR_tokens = "{{custom_token}}",
LR_tokenCustomString = LrPathUtils.removeExtension( photo:getFormattedMetadata( 'fileName' ) ):gsub( "[ %c]", "" ) -- remove spaces and control characters
sesn:doExportOnNewTask() -
Removing non-alpha-numeric characters from a string
How can I remove all non-alpha-numeric characters from a string? (i.e. only alpha-numerics should remain in the string).
Or even without a loop ?
Extract from the help for the Search and Replace String function :
Right-click the Search and Replace String function and select Regular Expression from the shortcut menu to configure the function for advanced regular expression searches and partial match substitution in the replacement string.
Extract from the for the advanced search options :
[a-zA-Z0-9] matches any lowercase or uppercase letter or any digit. You also can use a character class to match any character not in a given set by adding a caret (^) to the beginning of the class. For example [^a-zA-Z0-9] matches any character that is not a lowercase or uppercase letter and also not a digit.
Message Edité par JB le 05-06-2008 01:49 PM
Attachments:
Example_VI_BD4.png 2 KB -
Remove all non-number characters from a string
hi
How i can remove all non-number characters from a column ? for example , i have a column that contains data like
'sd3456'
'gfg87s989'
'45/45fgfg'
'4354-df4456'
and i want to convert it to
'3456'
'87989'
'4545'
'43544456'
thx in advOr in 9i,
Something like this ->
satyaki>
satyaki>with vat
2 as
3 (
4 select 'sd3456' cola from dual
5 union all
6 select 'gfg87s989' from dual
7 union all
8 select '45/45fgfg' from dual
9 union all
10 select '4354-df4456' from dual
11 )
12 select translate(cola,'abcdefghijklmnopqrstuvwxyz-/*#$%^&@()/?,<>;:{}[]|\`"',' ') res
13 from vat;
RES
3456
87989
4545
43544456
Elapsed: 00:00:00.00
satyaki>
{code}
I checked this with minimum test cases. It will be better if you checked it with other cases.
Regards.
Satyaki De.
Maybe you are looking for
-
Ipod nano not detected in windows XP but getting recharged thro USB
As i said, i have connected my ipod nano (4GB) to a usp port but its not getting detected either in windows explorer or itunes, nut strangely, its getting recharged. I checked with different USB ports in same machine and in other machines, i tried di
-
How can I create a new library in iTunes 12?
This is for the newest iTunes: 12.0.1.26 for the OSX version 10.9.5--- the other methods I found online don't work. Thanks!
-
Boot Camp not recognizing disc
Alright, so it seems as though I have had problem after problem trying to setup my Windows 7 boot camp. Normally I don't actually create new posts but with this issue I have not been able to find any solid answer yet. I have tried multiple times to b
-
Hi All Please help me with the following query. We are migrating SAP BW 7.4 on Oracle to HANA. We have few WEBI report's universes built on BEx queries. In one of those reports there are some hidden RKFs, these works perfectly fine in reports based o
-
Hi All I'm using JDeveloper 11g. When I started JDeveloper, the following error appear. Unexpected severe error has occurred in JDeveloper The program may be unstable, which could result in data loss. Decide how you want to proceed and click OK. View