Reputation: 11
I'm having problems trying to create a batch script that will search through a txt file in a directory for a value "drawing_revision" and then take the line from this and extract the revision and set it as a variable I can use as a prefix on file names.
DRAWING_REVISION 00 TYPE: String
Has anyone done anything like this before? there doesn't seem to be much on using the line within the text file as a variable rather than the file name.
Thanks
Dave
Upvotes: 1
Views: 360
Reputation: 82247
You could try a FOR-LOOP
for /F "usebackq tokens=2" %%a IN (`findstr DRAWING_REVISION myfile.txt`) do (
echo Draw-Rev = %%a
)
Upvotes: 1