[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

command prompt dail string formating Windows OS

Posted on 2014-12-11
4
Medium Priority
?
174 Views
Last Modified: 2014-12-11
How to format parameter passed to the bat file.
I batch file to start an application from command line with %1 parameter.
Say batch file string looks like one below
Mytest.bat
C:\path\myprog.exe %1
I My case %1 is a caller ID passed from another application where I don’t have any control over to change the format of the telephone number supplied to me.
Phone number passed from the source will look like
 xxxxxxxxx for example 18527956430
While the phone number in the data I want it to compare with is written in format below.
xxx/xxx-xxxx 852/795-6430
 I don’t access or (don’t want to change formatting in the target and I don’t have any control   on the source of %1)
I am looking for the way to break down %1 by characters so I can make original xxxxxxxxxx to look like in the target data set.
So it should look logically something like the string below, but a working script.
C:\path\myprog.exe %1(chars 2,3,4)+ ”/” +%1(chars 5,6,7) +”-“ %(chars 8,9,10,11)
I only have access to the bat file syntax and neither source (ShoreTel easy pop see screenshot attached)  of %1, nor target data cannot be changed. Batch file is started by EasyPop program which is passing caller id.

I only modify  the batch file and don’t have access to Easy Pop or the target data source
easypop.jpg
0
Comment
Question by:leop1212
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 25

Accepted Solution

by:
NVIT earned 2000 total points
ID: 40494361
Does something like this help?
set src=%1
set tgt=%src:~1,3%/%src:~4,3%-%src:~7,4%
echo tgt=%tgt%

Open in new window

0
 

Author Comment

by:leop1212
ID: 40494793
that is briliant. excelent work thank you very much
0
 

Author Closing Comment

by:leop1212
ID: 40494794
true expert. for sure
0
 
LVL 25

Expert Comment

by:NVIT
ID: 40494828
You're welcome, Leop1212. I am glad I could help. Thanks for the points.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question