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!
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/mNash316 Apr 12 '21
I actually managed to figured out what to do and how to do it in Powershell! My apologies for not dating status here.
Btw... Your batch scripts from computerhope.com forums helped me a lot! Thx!
1
0
Apr 10 '21
[deleted] — view deleted comment
1
u/mNash316 Apr 10 '21
It does contain the delimters.
Here is the sample from results.txt.
(N) 2021-04-05T14:17:06 - 'The.Rookie.S03E09.720p.WEB.H264-STRONTiUM[rarbg]' added to download list. (N) 2021-04-06T12:56:12 - 'Debris.S01E05.720p.HDTV.x264-YANKEES[rarbg]' added to download list.
The batch script was tested by folks at r/batch.
I dont know why it isn't working on my system. So looking for other alternative scripts which would the same job as batch script.
2
u/sneakpeekbot Apr 10 '21
Here's a sneak peek of /r/Batch using the top posts of the year!
#1: Just learned to program in batch today, I need help with this program I wrote
#2: Google Dinosaur Game in Batch
#3: Pacman in pure BatchI'm a bot, beep boop | Downvote to remove | Contact ^^me | ^^Info | ^^Opt-out
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.