1.

Solve : String manipulation in a batch file?

Answer»

How do I manipulate a string from within a batch file?

I need to know if a file_name entered in %1 has a dash (-) on it to change the course of processing with an @ifi cant understand ur last STATMENT
put u can manibulat the srting see this examble

set a=hi there ?
echo %a:~0,1%
echo %a:~-1%
echo %a:~0,-2%

and for mor info see the set command

and if u want to REPLACE characters u can use

set a=hi there ?
set b=%a: =,%
echo %b%.bat_man, I don't THINK that is what fermat73 asked.

Quote

I need to know if a file_name entered in %1 has a dash (-) on it to change the course of processing

Code: [Select]@echo off
echo "%1" | find "-">nul && goto yes
goto no

:yes
echo filename contains one or more DASHES

goto NEXT

:no
echo filename does not contain any dashes

:next

Well done, SummerDays.
I want to thank you both cuz I learned a lot today.
What .bat_man said, tho it didn't really solve my problem, helped quite a lot, but you got to the point.

Quote from: fermat73 on June 08, 2008, 02:17:58 PM
Well done, SummerDays.

You are the first person who said they understand my screen name! It's a song by Amaral.
i didn't understand ur question correctly and thats bad for me
put i am happy that u had something useful from my responce
and what a good meaning Dias de verano


Discussion

No Comment Found