HI
I refered this URL to find 8 characters but not working properly
http://www.dostips.com/DtCodeFunctions. ... c128586394
My requirement is
set string=abcdefghijk (11 characters i have taken)
I need to count the 8 charactes only if it is more than 8 i need to skip
anybody can help me to sort out this issue
Thanks & Regards
Sivaram Nv
length should be 8 characters
Moderator: DosItHelp
-
- Posts: 4
- Joined: 30 Aug 2007 02:29
Hi All
Please find solution for the below query
@echo off
REM the below mentioned str having more than 8 characters
set str=Sivaramnv
echo Given Queue Manager Nae %str%
set str1=%str:~0,8%
echo After 8 Strings the QM name is %str1%
set str2=%str%
set str2=%str2:~8%
echo After 8 Characters result of QM Name %str2%
set string01=%str1%
set string02=%str2%
set final_string=%string01%%string02%
echo total 2 strings(1st 8 and after %final_string%
IF "%string02%" EQU "" GOTO START
GOTO STOP
:START
echo 8 character Qmanager Name is %final_string%
GOTO END
:STOP
echo You have exceeded more than 8 characters
GOTO END
:END
Please find solution for the below query
@echo off
REM the below mentioned str having more than 8 characters
set str=Sivaramnv
echo Given Queue Manager Nae %str%
set str1=%str:~0,8%
echo After 8 Strings the QM name is %str1%
set str2=%str%
set str2=%str2:~8%
echo After 8 Characters result of QM Name %str2%
set string01=%str1%
set string02=%str2%
set final_string=%string01%%string02%
echo total 2 strings(1st 8 and after %final_string%
IF "%string02%" EQU "" GOTO START
GOTO STOP
:START
echo 8 character Qmanager Name is %final_string%
GOTO END
:STOP
echo You have exceeded more than 8 characters
GOTO END
:END