Wednesday 20 June 2018

Any way to get the first few characters of filename in DOS batch file Programming


I am using this in my program


for %%I in (*.txt) do (

The filename is in %%I.


Now i want to separate the first 2 chracters, next 3 characters, separately.


Is this possible in DOS or Cmd.exe?



Answer



http://www.dostips.com/DtTipsStringManipulation.php


set first2=%%I:~0,2% && set next3=%%I:~3,3%

I think.. geez, its been a while!


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...