1.

Solve : Read a particular word using DOS??

Answer»

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:
Code: [Select]@echo off
set data=ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM NOPQRSTUVWXYZ
echo %data%
set data1=%data:~3,3%
set data2=%data:~8,3%
echo %data1%%data2%
PAUSE



Discussion

No Comment Found