Computer Hope
Microsoft => Microsoft DOS => Topic started by: vinoth124 on September 17, 2008, 05:33:16 AM
-
Hi,
Is there is any possiblity to read a particular word in a text file. I know where the word will start and end.
For example:
Consider the text file contains the following content...,
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM NOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM NOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM NOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM NOPQRSTUVWXYZ
I need to read the character from 4th position to 9th position of the line1.
i.e., I need to get "DEFIJK" alone from this text file.
Will you please help me to resolve the same.
Thanks in advance...,
With Regards,
Vinoth R
:)
-
The easiest way:
@echo off
set data=ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM NOPQRSTUVWXYZ
echo %data%
set data1=%data:~3,3%
set data2=%data:~8,3%
echo %data1%%data2%
pause