spacing - Batch to duplicate text lines including spaces -
i'm using windows 7. need batch file copy lines of 1 text file individual files. batch file i've written far works perfectly:
@echo off setlocal enabledelayedexpansion set counter=1 /f %%x in (originallist.txt) ( set "line_!counter!=%%x" set /a counter+=1 ) set /a numlines=counter - 1 echo %line_1% >a1.txt echo %line_2% >a2.txt echo %line_3% >a3.txt echo %line_4% >a4.txt echo %line_5% >a5.txt
the problem have lines of text contain space ie
c:\users\my account\documents\line saving
saves as
c:\users\my
how store entire line??
your problem: space 1 of standard delimiters of for
. if don't define token, defaults one. string first space or comma or semicolon, ...
solution: set delimters none (no delimiter):
for /f "delims=" %%x in (originallist.txt) (
Comments
Post a Comment