Solved Batch File Related To Text Files

June 27, 2020 at 09:48:45
Specs: Windows 10
I want to make a batch file..
I have a text file (say primary.txt) which has data stored like in following format

Episode 01 - http://abcd.com/w2WUQF
Episode 02 - http://abcd.com/w2WUQL
Episode 03 - http://abcd.com/w2WUQB
Episode 04 - http://abcd.com/w2WUQ3
Episode 05 - http://abcd.com/w2WUQ8
Episode 06 - http://abcd.com/w2WUWe
Episode 07 - http://abcd.com/w2WUWi
Episode 08 - http://abcd.com/w2WUWd
Episode 09 - http://abcd.com/w2WUWk
Episode 10 - http://abcd.com/w2WUWv
Episode 11 - http://abcd.com/w2WUWW
Episode 12 - http://abcd.com/w2WUWU
Episode 13 - http://abcd.com/w2WUWS

i want that batch file to make another text file (say secondary.txt) in the same directory
such that it contains data like

http://abcd.com/w2WUQF
http://abcd.com/w2WUQL
http://abcd.com/w2WUQB
http://abcd.com/w2WUQ3
http://abcd.com/w2WUQ8
http://abcd.com/w2WUWe
http://abcd.com/w2WUWi
http://abcd.com/w2WUWd
http://abcd.com/w2WUWk
http://abcd.com/w2WUWv
http://abcd.com/w2WUWW
http://abcd.com/w2WUWU
http://abcd.com/w2WUWS

I am new to this batch file and all and know very little about it

Any Help Is Appreciated.. ;D ;D

message edited by DoDO0503


See More: Batch File Related To Text Files

Reply ↓  Report •

#1
June 27, 2020 at 10:32:05
✔ Best Answer
::====== script starts here ===============
::
:: pri2sec.bat 2020-06-28 0:27:19.93
@echo off > secondary.TXT & setLocal enableDELAYedeXpansioN

for /f "tokens=2 delims=-" %%a in ( primary.txt ) do (
echo.%%a
) >> secondary.TXT
goto :eof
::====== script ends here =================

=====================

M2


Reply ↓  Report •

#2
June 27, 2020 at 19:23:08
Thanks It Worked Like A Charm..!!

message edited by DoDO0503


Reply ↓  Report •
Related Solutions


Ask Question