r/vbscript • u/mNash316 • Apr 10 '21
HELP:- VBScript to delete text before and after delimiter
Hi All,
This is a batch script I have.
IF EXIST list.tmp DEL list.tmp
for /f "delims=' tokens=2" %%A in (results.txt) do >>list.tmp echo %%A
IF EXIST list.tmp (
sort list.tmp > Final.txt
DEL list.tmp
)For some reason "FOR /F" command is not processing results.txt on my system.
Can anyone post a VBScript that can do the same thing?
Thanks!
4
Upvotes
1
u/jcunews1 Apr 10 '21
With batch file
for /fcommand, you don't delete text. You rebuild the delimited text without the unwanted text.1
u/hackoofr Apr 12 '21
You should post exactly what you want to get as result and from what input file ?
And this can be done with vbscript using RegEx, i think !
Just post the InputFile and the desried Ouputfile on pastebin and share their links here to undersantd more your issue !
1
u/Dr_Legacy Apr 11 '21
why do you have
>>list.tmpbeforeecho %%A?0
u/[deleted] Apr 10 '21
[deleted] — view deleted comment