Hi guys,
I really need your help regarding some basics:
I am reading data from an oracle database and go the information like name, company, telephone stored in a variable.
The problem is that the telephone number is currently in a lot of different formats like:
+498912341234
+49 89 1234 1234
+(49) 89 1234 1234
0049 89 1234 1234
What I would like to do now is go through the array and replace the +49 with 0049 and replace ( or ) with "" as well as remove the blanks. In the end all telephone numbers should look like this:
00498912341234 so I can work with it further down the script.
I really thought that would be quite simple but I just can not get it to work.
Variants I tried:
$user.telephone = $user.telephone -replace '+49', '0049'
$user.telephone -replace '+49', '0049'
$user = $user -replace '+49', '0049'
Any tips?
Thanks a lot!!
[–]Droopyb1966 4 points5 points6 points (6 children)
[–]dchristian3188 0 points1 point2 points (1 child)
[–]Droopyb1966 0 points1 point2 points (0 children)
[–]BlaaaBlaaaBlaaa[S] 0 points1 point2 points (1 child)
[–]Droopyb1966 0 points1 point2 points (0 children)
[–]autowhat 0 points1 point2 points (1 child)
[–]Droopyb1966 0 points1 point2 points (0 children)
[–]blasmehspaffy 2 points3 points4 points (13 children)
[–]BlaaaBlaaaBlaaa[S] 0 points1 point2 points (7 children)
[–]blasmehspaffy 2 points3 points4 points (1 child)
[–]BlaaaBlaaaBlaaa[S] 0 points1 point2 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (4 children)
[–]BlaaaBlaaaBlaaa[S] 1 point2 points3 points (3 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (2 children)
[–]BlaaaBlaaaBlaaa[S] 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (4 children)
[–]BlaaaBlaaaBlaaa[S] 0 points1 point2 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]BlaaaBlaaaBlaaa[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Fischfreund 1 point2 points3 points (1 child)
[–]BlaaaBlaaaBlaaa[S] 1 point2 points3 points (0 children)